mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Ensure only single content-type header when using json post-processor
This commit is contained in:
parent
e3c8ab98b1
commit
b14405e6a1
@ -17,7 +17,7 @@ from calibre.srv.utils import http_date
|
||||
default_methods = frozenset(('HEAD', 'GET'))
|
||||
|
||||
def json(ctx, rd, endpoint, output):
|
||||
rd.outheaders['Content-Type'] = 'application/json; charset=UTF-8'
|
||||
rd.outheaders.set('Content-Type', 'application/json; charset=UTF-8', replace_all=True)
|
||||
if isinstance(output, bytes):
|
||||
ans = output # Assume output is already UTF-8 encoded json
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user