From b77e03d769f6665198d2e30cc214d2cab1a42d2f Mon Sep 17 00:00:00 2001 From: Phil Borman Date: Sun, 3 Jun 2018 09:34:16 +0200 Subject: [PATCH] Ensure rss feed is bytes --- lazylibrarian/webServe.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lazylibrarian/webServe.py b/lazylibrarian/webServe.py index 69132c7f0..f1d5846b4 100644 --- a/lazylibrarian/webServe.py +++ b/lazylibrarian/webServe.py @@ -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 @@ -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):