##// 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 def _start_transaction(self, h, req):
299 def _start_transaction(self, h, req):
300 # What follows mostly reimplements HTTPConnection.request()
300 # What follows mostly reimplements HTTPConnection.request()
301 # except it adds self.parent.addheaders in the mix.
301 # except it adds self.parent.addheaders in the mix and sends headers
302 headers = dict(self.parent.addheaders)
302 # in a deterministic order (to make testing easier).
303 headers.update(req.headers)
303 headers = util.sortdict(self.parent.addheaders)
304 headers.update(req.unredirected_hdrs)
304 headers.update(sorted(req.headers.items()))
305 headers = dict((n.lower(), v) for n, v in headers.items())
305 headers.update(sorted(req.unredirected_hdrs.items()))
306 headers = util.sortdict((n.lower(), v) for n, v in headers.items())
306 skipheaders = {}
307 skipheaders = {}
307 for n in ('host', 'accept-encoding'):
308 for n in ('host', 'accept-encoding'):
308 if n in headers:
309 if n in headers:
General Comments 0
You need to be logged in to leave comments. Login now