##// END OF EJS Templates
hgweb: make parsedrequest part of wsgirequest...
Gregory Szorc -
r36872:1f7d9024 default
parent child Browse files
Show More
@@ -304,7 +304,7 b' class hgweb(object):'
304 yield r
304 yield r
305
305
306 def _runwsgi(self, wsgireq, repo):
306 def _runwsgi(self, wsgireq, repo):
307 req = requestmod.parserequestfromenv(wsgireq.env)
307 req = wsgireq.req
308 rctx = requestcontext(self, repo)
308 rctx = requestcontext(self, repo)
309
309
310 # This state is global across all threads.
310 # This state is global across all threads.
@@ -287,6 +287,11 b' class hgwebdir(object):'
287 real = repos.get(virtualrepo)
287 real = repos.get(virtualrepo)
288 if real:
288 if real:
289 wsgireq.env['REPO_NAME'] = virtualrepo
289 wsgireq.env['REPO_NAME'] = virtualrepo
290 # We have to re-parse because of updated environment
291 # variable.
292 # TODO this is kind of hacky and we should have a better
293 # way of doing this than with REPO_NAME side-effects.
294 wsgireq.req = requestmod.parserequestfromenv(wsgireq.env)
290 try:
295 try:
291 # ensure caller gets private copy of ui
296 # ensure caller gets private copy of ui
292 repo = hg.repository(self.ui.copy(), real)
297 repo = hg.repository(self.ui.copy(), real)
@@ -254,6 +254,8 b' class wsgirequest(object):'
254 self.server_write = None
254 self.server_write = None
255 self.headers = []
255 self.headers = []
256
256
257 self.req = parserequestfromenv(wsgienv)
258
257 def respond(self, status, type, filename=None, body=None):
259 def respond(self, status, type, filename=None, body=None):
258 if not isinstance(type, str):
260 if not isinstance(type, str):
259 type = pycompat.sysstr(type)
261 type = pycompat.sysstr(type)
General Comments 0
You need to be logged in to leave comments. Login now