Commit 011d280a authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

fix: redirect only on 200

parent d20601d2
Pipeline #6124 passed with stage
in 1 minute and 23 seconds
......@@ -9,7 +9,7 @@ class AllowOnlySiteUrl:
def __call__(self, request):
response = self.get_response(request)
if(is_safe_url(request.get_raw_uri(), allowed_hosts=settings.SITE_URL)):
if(is_safe_url(request.get_raw_uri(), allowed_hosts=settings.SITE_URL) or response.status_code != 200):
return response
return redirect('{}{}'.format(settings.SITE_URL, request.path))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment