##// END OF EJS Templates
keepalive: send HTTP request headers in a deterministic order...
Gregory Szorc -
r31999:aa836f56 default
parent child Browse files
Show More
@@ -298,11 +298,12 b' class KeepAliveHandler(object):'
298 298
299 299 def _start_transaction(self, h, req):
300 300 # What follows mostly reimplements HTTPConnection.request()
301 # except it adds self.parent.addheaders in the mix.
302 headers = dict(self.parent.addheaders)
303 headers.update(req.headers)
304 headers.update(req.unredirected_hdrs)
305 headers = dict((n.lower(), v) for n, v in headers.items())
301 # except it adds self.parent.addheaders in the mix and sends headers
302 # in a deterministic order (to make testing easier).
303 headers = util.sortdict(self.parent.addheaders)
304 headers.update(sorted(req.headers.items()))
305 headers.update(sorted(req.unredirected_hdrs.items()))
306 headers = util.sortdict((n.lower(), v) for n, v in headers.items())
306 307 skipheaders = {}
307 308 for n in ('host', 'accept-encoding'):
308 309 if n in headers:
General Comments 0
You need to be logged in to leave comments. Login now