##// END OF EJS Templates
hgweb: fill in content-type and content-length as native strings...
Augie Fackler -
r34723:95be8928 default
parent child Browse files
Show More
@@ -93,14 +93,14 b' class wsgirequest(object):'
93 if not isinstance(type, str):
93 if not isinstance(type, str):
94 type = pycompat.sysstr(type)
94 type = pycompat.sysstr(type)
95 if self._start_response is not None:
95 if self._start_response is not None:
96 self.headers.append(('Content-Type', type))
96 self.headers.append((r'Content-Type', type))
97 if filename:
97 if filename:
98 filename = (filename.rpartition('/')[-1]
98 filename = (filename.rpartition('/')[-1]
99 .replace('\\', '\\\\').replace('"', '\\"'))
99 .replace('\\', '\\\\').replace('"', '\\"'))
100 self.headers.append(('Content-Disposition',
100 self.headers.append(('Content-Disposition',
101 'inline; filename="%s"' % filename))
101 'inline; filename="%s"' % filename))
102 if body is not None:
102 if body is not None:
103 self.headers.append(('Content-Length', str(len(body))))
103 self.headers.append((r'Content-Length', str(len(body))))
104
104
105 for k, v in self.headers:
105 for k, v in self.headers:
106 if not isinstance(v, str):
106 if not isinstance(v, str):
General Comments 0
You need to be logged in to leave comments. Login now