Mercurial > p > roundup > code
comparison roundup/cgi/apache.py @ 4908:92757447dcf0 routing
Remove PATH_INFO hacks that strip leading slash
PATH_INFO should always start with '/' when not empty, see
http://tools.ietf.org/html/rfc3875#section-4.1.5
Instead, do leading slash stripping inside cgi.client
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Wed, 16 Jul 2014 03:10:02 +0300 |
| parents | 302bc481ceb1 |
| children |
comparison
equal
deleted
inserted
replaced
| 4907:c37069a99cec | 4908:92757447dcf0 |
|---|---|
| 119 __tracker_cache_lock.release() | 119 __tracker_cache_lock.release() |
| 120 # create environment | 120 # create environment |
| 121 # Note: cookies are read from HTTP variables, so we need all HTTP vars | 121 # Note: cookies are read from HTTP variables, so we need all HTTP vars |
| 122 req.add_common_vars() | 122 req.add_common_vars() |
| 123 _env = dict(req.subprocess_env) | 123 _env = dict(req.subprocess_env) |
| 124 # XXX classname must be the first item in PATH_INFO. roundup.cgi does: | |
| 125 # path = string.split(os.environ.get('PATH_INFO', '/'), '/') | |
| 126 # os.environ['PATH_INFO'] = string.join(path[2:], '/') | |
| 127 # we just remove the first character ('/') | |
| 128 _env["PATH_INFO"] = req.path_info[1:] | |
| 129 if _timing: | 124 if _timing: |
| 130 _env["CGI_SHOW_TIMING"] = _timing | 125 _env["CGI_SHOW_TIMING"] = _timing |
| 131 _form = cgi.FieldStorage(req, environ=_env) | 126 _form = cgi.FieldStorage(req, environ=_env) |
| 132 _client = _tracker.Client(_tracker, Request(req), _env, _form, | 127 _client = _tracker.Client(_tracker, Request(req), _env, _form, |
| 133 translator=TranslationService.get_translation(_lang, | 128 translator=TranslationService.get_translation(_lang, |
