comparison mercurial/hgweb/protocol.py @ 34740:b2601c5977a4

hgweb: more "http headers are native strs" cleanup Differential Revision: https://phab.mercurial-scm.org/D1108
author Augie Fackler <augie@google.com>
date Sun, 15 Oct 2017 00:38:33 -0400
parents c23fa3103925
children 5a9cad0dfddb
comparison
equal deleted inserted replaced
34739:b880cc11da5d 34740:b2601c5977a4
73 73
74 argvalue = decodevaluefromheaders(self.req, 'X-HgArg') 74 argvalue = decodevaluefromheaders(self.req, 'X-HgArg')
75 args.update(cgi.parse_qs(argvalue, keep_blank_values=True)) 75 args.update(cgi.parse_qs(argvalue, keep_blank_values=True))
76 return args 76 return args
77 def getfile(self, fp): 77 def getfile(self, fp):
78 length = int(self.req.env['CONTENT_LENGTH']) 78 length = int(self.req.env[r'CONTENT_LENGTH'])
79 # If httppostargs is used, we need to read Content-Length 79 # If httppostargs is used, we need to read Content-Length
80 # minus the amount that was consumed by args. 80 # minus the amount that was consumed by args.
81 length -= int(self.req.env.get('HTTP_X_HGARGS_POST', 0)) 81 length -= int(self.req.env.get(r'HTTP_X_HGARGS_POST', 0))
82 for s in util.filechunkiter(self.req, limit=length): 82 for s in util.filechunkiter(self.req, limit=length):
83 fp.write(s) 83 fp.write(s)
84 def redirect(self): 84 def redirect(self):
85 self.oldio = self.ui.fout, self.ui.ferr 85 self.oldio = self.ui.fout, self.ui.ferr
86 self.ui.ferr = self.ui.fout = stringio() 86 self.ui.ferr = self.ui.fout = stringio()