mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
Fixes environ paths when default_locale set (#873)
If the default_locale was set and the URL path didn't contain a language code, it was behaving as if there was a language code in the URL. In that case, it was moving part of the PATH_INFO to SCRIPT_NAME, but as there wasn't any language code in the URL, it moved something else. This fixes that.
This commit is contained in:
parent
79140441df
commit
013746c10a
@ -667,10 +667,14 @@ class FrontEndApp(object):
|
|||||||
# store original script_name (original prefix) before modifications are made
|
# store original script_name (original prefix) before modifications are made
|
||||||
environ['ORIG_SCRIPT_NAME'] = environ.get('SCRIPT_NAME')
|
environ['ORIG_SCRIPT_NAME'] = environ.get('SCRIPT_NAME')
|
||||||
|
|
||||||
lang = args.pop('lang', self.default_locale)
|
lang = args.pop('lang', '')
|
||||||
if lang:
|
if lang:
|
||||||
pop_path_info(environ)
|
pop_path_info(environ)
|
||||||
|
|
||||||
|
if lang:
|
||||||
environ['pywb_lang'] = lang
|
environ['pywb_lang'] = lang
|
||||||
|
elif self.default_locale:
|
||||||
|
environ['pywb_lang'] = self.default_locale
|
||||||
|
|
||||||
response = endpoint(environ, **args)
|
response = endpoint(environ, **args)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user