mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add a uuid to the headers for OPDS feeds. Allows OPDS consuming applications to distinguish between different calibre installs. Fixes #1756666 [OPDS feed id should be unique](https://bugs.launchpad.net/calibre/+bug/1756666)
This commit is contained in:
parent
0a89d65246
commit
6a5e979b0b
@ -21,6 +21,8 @@ from calibre import guess_type, prepare_string_for_xml as xml
|
||||
from calibre.utils.icu import sort_key
|
||||
from calibre.utils.date import as_utc, timestampfromdt, is_date_undefined
|
||||
from calibre.utils.search_query_parser import ParseException
|
||||
from calibre.utils.config import prefs
|
||||
from calibre import force_unicode
|
||||
|
||||
from calibre.srv.errors import HTTPNotFound, HTTPInternalServerError
|
||||
from calibre.srv.routes import endpoint
|
||||
@ -39,6 +41,7 @@ def unhexlify(x):
|
||||
|
||||
def atom(ctx, rd, endpoint, output):
|
||||
rd.outheaders.set('Content-Type', 'application/atom+xml; charset=UTF-8', replace_all=True)
|
||||
rd.outheaders.set('Calibre-Instance-Id', force_unicode(prefs['installation_uuid'], 'utf-8'), replace_all=True)
|
||||
if isinstance(output, bytes):
|
||||
ans = output # Assume output is already UTF-8 XML
|
||||
elif isinstance(output, type('')):
|
||||
|
Loading…
x
Reference in New Issue
Block a user