comparison mercurial/hgweb/hgweb_mod.py @ 36915:84110a1d0f7d

hgweb: store the raw WSGI environment dict We need this so we can construct a new request instance from the original dict. Differential Revision: https://phab.mercurial-scm.org/D2831
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 11 Mar 2018 16:19:20 -0700
parents d0b0fedbfb53
children f0a851542a05
comparison
equal deleted inserted replaced
36914:cd6ae9ab7bd8 36915:84110a1d0f7d
310 res = wsgireq.res 310 res = wsgireq.res
311 rctx = requestcontext(self, repo, req, res) 311 rctx = requestcontext(self, repo, req, res)
312 312
313 # This state is global across all threads. 313 # This state is global across all threads.
314 encoding.encoding = rctx.config('web', 'encoding') 314 encoding.encoding = rctx.config('web', 'encoding')
315 rctx.repo.ui.environ = wsgireq.env 315 rctx.repo.ui.environ = req.rawenv
316 316
317 if rctx.csp: 317 if rctx.csp:
318 # hgwebdir may have added CSP header. Since we generate our own, 318 # hgwebdir may have added CSP header. Since we generate our own,
319 # replace it. 319 # replace it.
320 res.headers['Content-Security-Policy'] = rctx.csp 320 res.headers['Content-Security-Policy'] = rctx.csp