Fix duplicate Content-Type header for some resources

This commit is contained in:
Kovid Goyal 2017-04-06 15:09:24 +05:30
parent 5db33faeb8
commit 79f47bfd8a

View File

@ -499,7 +499,7 @@ class HTTPConnection(HTTPRequest):
ct = outheaders.get('Content-Type', '')
if ct.startswith('text/') and 'charset=' not in ct:
outheaders.set('Content-Type', ct + '; charset=UTF-8')
outheaders.set('Content-Type', ct + '; charset=UTF-8', replace_all=True)
buf = [HTTP11 + (' %d ' % data.status_code) + httplib.responses[data.status_code]]
for header, value in sorted(outheaders.iteritems(), key=itemgetter(0)):