From b14405e6a1367ea63914b6b198617a8d24f7a4e0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 21 Dec 2015 15:47:43 +0530 Subject: [PATCH] Ensure only single content-type header when using json post-processor --- src/calibre/srv/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/srv/routes.py b/src/calibre/srv/routes.py index 66d482b47b..4c2624f1b9 100644 --- a/src/calibre/srv/routes.py +++ b/src/calibre/srv/routes.py @@ -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: