Skip to content

Commit

Permalink
Redirect to lang only if supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
glogiotatidis committed May 24, 2016
1 parent 7f798a9 commit 6c9ecc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kitsune/sumo/middleware.py
Expand Up @@ -34,9 +34,10 @@ def process_request(self, request):
set_url_prefixer(prefixer)
full_path = prefixer.fix(prefixer.shortened_path)

if 'lang' in request.GET:
if request.GET.get('lang', '') in settings.SUMO_LANGUAGES:
# Blank out the locale so that we can set a new one. Remove lang
# from the query params so we don't have an infinite loop.

prefixer.locale = ''
new_path = prefixer.fix(prefixer.shortened_path)
query = dict((smart_str(k), v) for
Expand Down

0 comments on commit 6c9ecc9

Please sign in to comment.