Mercurial > public > mercurial-scm > hg
diff mercurial/hgweb/hgweb_mod.py @ 36814:f9078c6caeb6
hgweb: parse and store HTTP request headers
WSGI transmits HTTP request headers as HTTP_* environment variables.
We teach our parser about these and hook up a dict-like data
structure that supports case insensitive header manipulation.
Differential Revision: https://phab.mercurial-scm.org/D2742
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 08 Mar 2018 16:22:25 -0800 |
parents | 158d4ecc03c8 |
children | 1f7d9024674c |
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py Thu Mar 08 16:43:32 2018 -0800 +++ b/mercurial/hgweb/hgweb_mod.py Thu Mar 08 16:22:25 2018 -0800 @@ -351,7 +351,7 @@ if args: wsgireq.form['file'] = args - ua = wsgireq.env.get('HTTP_USER_AGENT', '') + ua = req.headers.get('User-Agent', '') if cmd == 'rev' and 'mercurial' in ua: wsgireq.form['style'] = ['raw']