##// END OF EJS Templates
hgweb: more "http headers are native strs" cleanup...
Augie Fackler -
r34741:b2601c59 default
parent child Browse files
Show More
@@ -378,7 +378,7 b' class hgweb(object):'
378 req.env.get('X-HgHttp2', '')):
378 req.env.get('X-HgHttp2', '')):
379 req.drain()
379 req.drain()
380 else:
380 else:
381 req.headers.append(('Connection', 'Close'))
381 req.headers.append((r'Connection', r'Close'))
382 req.respond(inst, protocol.HGTYPE,
382 req.respond(inst, protocol.HGTYPE,
383 body='0\n%s\n' % inst)
383 body='0\n%s\n' % inst)
384 return ''
384 return ''
@@ -75,10 +75,10 b' class webproto(wireproto.abstractserverp'
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):
@@ -194,9 +194,9 b' class _httprequesthandler(httpservermod.'
194 self._chunked = (not self.close_connection and
194 self._chunked = (not self.close_connection and
195 self.request_version == "HTTP/1.1")
195 self.request_version == "HTTP/1.1")
196 if self._chunked:
196 if self._chunked:
197 self.send_header('Transfer-Encoding', 'chunked')
197 self.send_header(r'Transfer-Encoding', r'chunked')
198 else:
198 else:
199 self.send_header('Connection', 'close')
199 self.send_header(r'Connection', r'close')
200 self.end_headers()
200 self.end_headers()
201 self.sent_headers = True
201 self.sent_headers = True
202
202
General Comments 0
You need to be logged in to leave comments. Login now