##// END OF EJS Templates
core-app: use a consistent pep-3333 compatible PATH_INFO extraction
super-admin -
r5031:975a5705 default
parent child Browse files
Show More
@@ -48,6 +48,7 b' from rhodecode.lib.exceptions import (Us'
48 from rhodecode.lib.hooks_daemon import prepare_callback_daemon
48 from rhodecode.lib.hooks_daemon import prepare_callback_daemon
49 from rhodecode.lib.middleware import appenlight
49 from rhodecode.lib.middleware import appenlight
50 from rhodecode.lib.middleware.utils import scm_app_http
50 from rhodecode.lib.middleware.utils import scm_app_http
51 from rhodecode.lib.str_utils import safe_bytes
51 from rhodecode.lib.utils import is_valid_repo, SLUG_RE
52 from rhodecode.lib.utils import is_valid_repo, SLUG_RE
52 from rhodecode.lib.utils2 import safe_str, fix_PATH, str2bool, safe_unicode
53 from rhodecode.lib.utils2 import safe_str, fix_PATH, str2bool, safe_unicode
53 from rhodecode.lib.vcs.conf import settings as vcs_settings
54 from rhodecode.lib.vcs.conf import settings as vcs_settings
@@ -244,7 +245,10 b' class SimpleVCS(object):'
244 if by_id_match:
245 if by_id_match:
245 data[1] = by_id_match.repo_name
246 data[1] = by_id_match.repo_name
246
247
247 return safe_str('/'.join(data))
248 # Because PEP-3333-WSGI uses bytes-tunneled-in-latin-1 as PATH_INFO
249 # and we use this data
250 maybe_new_path = '/'.join(data)
251 return safe_bytes(maybe_new_path).decode('latin1')
248
252
249 def _invalidate_cache(self, repo_name):
253 def _invalidate_cache(self, repo_name):
250 """
254 """
@@ -17,3 +17,12 b''
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
21 from rhodecode.lib.str_utils import safe_str
22
23
24 def get_path_info(environ):
25 """
26 Because PEP-3333-WSGI uses bytes-tunneled-in-latin-1 as PATH_INFO, we use a decoded version here !
27 """
28 return safe_str(environ['PATH_INFO'].encode('latin1'))
General Comments 0
You need to be logged in to leave comments. Login now