mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
Fixes switch_locale not adding locale if missing from URL (#871)
If the two letter language code was missing in the URI, switch_locale(locale) didn't add it (it worked fine if it was present). That means that it produced the same URL for all locales, each missing the two letter language code in the URL.
This commit is contained in:
parent
af92a9726e
commit
79140441df
@ -178,7 +178,7 @@ class JinjaEnv(object):
|
||||
|
||||
request_uri = environ.get('REQUEST_URI', environ.get('PATH_INFO'))
|
||||
|
||||
if curr_loc:
|
||||
if curr_loc and request_uri.startswith('/' + curr_loc + '/'):
|
||||
return request_uri.replace(curr_loc, locale, 1)
|
||||
|
||||
app_prefix = environ.get('pywb.app_prefix', '')
|
||||
|
Loading…
x
Reference in New Issue
Block a user