mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Content server: When serving OPDS feeds send the correct content-type header. Fixes #6329 (WebKit Browsers Unable to Access OPDS Catalog)
This commit is contained in:
parent
3251d1d6ed
commit
8b78f63d32
@ -341,7 +341,7 @@ class OPDSServer(object):
|
||||
items = items[offsets.offset:offsets.offset+max_items]
|
||||
updated = self.db.last_modified()
|
||||
cherrypy.response.headers['Last-Modified'] = self.last_modified(updated)
|
||||
cherrypy.response.headers['Content-Type'] = 'text/xml'
|
||||
cherrypy.response.headers['Content-Type'] = 'application/atom+xml;profile=opds-catalog'
|
||||
return str(AcquisitionFeed(updated, id_, items, offsets,
|
||||
page_url, up_url, version, self.db.FIELD_MAP))
|
||||
|
||||
@ -413,7 +413,7 @@ class OPDSServer(object):
|
||||
items = list(items)[offsets.offset:offsets.offset+max_items]
|
||||
|
||||
cherrypy.response.headers['Last-Modified'] = self.last_modified(updated)
|
||||
cherrypy.response.headers['Content-Type'] = 'text/xml'
|
||||
cherrypy.response.headers['Content-Type'] = 'application/atom+xml'
|
||||
|
||||
return str(CategoryFeed(items, category, id_, updated, version, offsets,
|
||||
page_url, up_url))
|
||||
@ -478,7 +478,7 @@ class OPDSServer(object):
|
||||
page_url, up_url)
|
||||
|
||||
cherrypy.response.headers['Last-Modified'] = self.last_modified(updated)
|
||||
cherrypy.response.headers['Content-Type'] = 'text/xml'
|
||||
cherrypy.response.headers['Content-Type'] = 'application/atom+xml'
|
||||
|
||||
return str(ans)
|
||||
|
||||
@ -552,7 +552,7 @@ class OPDSServer(object):
|
||||
updated = self.db.last_modified()
|
||||
|
||||
cherrypy.response.headers['Last-Modified'] = self.last_modified(updated)
|
||||
cherrypy.response.headers['Content-Type'] = 'text/xml'
|
||||
cherrypy.response.headers['Content-Type'] = 'application/atom+xml'
|
||||
|
||||
feed = TopLevel(updated, cats, version)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user