Skip to content

Commit

Permalink
Ensure rss feed is bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
philborman committed Jun 3, 2018
1 parent b50add8 commit b77e03d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lazylibrarian/webServe.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
from lazylibrarian.csvfile import import_CSV, export_CSV, dump_table, restore_table
from lazylibrarian.downloadmethods import NZBDownloadMethod, TORDownloadMethod, DirectDownloadMethod
from lazylibrarian.formatter import unaccented, unaccented_str, plural, now, today, check_int, replace_all, \
safe_unicode, cleanName, surnameFirst, sortDefinite, getList, makeUnicode, md5_utf8, dateFormat, check_year
safe_unicode, cleanName, surnameFirst, sortDefinite, getList, makeUnicode, makeBytestr, md5_utf8, dateFormat, \
check_year
from lazylibrarian.gb import GoogleBooks
from lazylibrarian.gr import GoodReads
from lazylibrarian.images import getBookCover
Expand Down Expand Up @@ -3439,13 +3440,14 @@ def rssFeed(self, **kwargs):
netloc = cherrypy.request.headers['X-Forwarded-Host']
except KeyError:
pass
filename = 'LazyLibrarian_' + ftype + '.xml'
filename = 'LazyLibrarian_RSS_' + ftype + '.xml'
path = path.replace('rssFeed', '').rstrip('/')
baseurl = urlunsplit((scheme, netloc, path, qs, anchor))
logger.info("RSS Feed request %s %s%s" % (limit, ftype, plural(limit)))
cherrypy.response.headers["Content-Type"] = 'application/rss+xml'
cherrypy.response.headers["Content-Disposition"] = 'attachment; filename="%s"' % filename
return genFeed(ftype, limit=limit, user=userid, baseurl=baseurl)
res = genFeed(ftype, limit=limit, user=userid, baseurl=baseurl)
return makeBytestr(res)

@cherrypy.expose
def importCSV(self):
Expand Down

0 comments on commit b77e03d

Please sign in to comment.