From 168e77d2b7fef46c74a4560fa7a28256ef09f207 Mon Sep 17 00:00:00 2001 From: Deimos Date: Wed, 31 Jul 2019 20:41:19 -0600 Subject: [PATCH] Fix issue with url-encoding X-IC-Redirect header --- tildes/tildes/views/api/web/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tildes/tildes/views/api/web/exceptions.py b/tildes/tildes/views/api/web/exceptions.py index ffa3f6b..e8d7a04 100644 --- a/tildes/tildes/views/api/web/exceptions.py +++ b/tildes/tildes/views/api/web/exceptions.py @@ -4,6 +4,7 @@ """Web API exception views.""" from typing import Sequence +from urllib.parse import quote from marshmallow.exceptions import ValidationError from pyramid.httpexceptions import ( @@ -106,4 +107,4 @@ def httpfound(request: Request) -> Response: 302 into a 200 with that header so it works as a redirect for both standard requests as well as Intercooler ones. """ - return Response(headers={"X-IC-Redirect": request.exception.location}) + return Response(headers={"X-IC-Redirect": quote(request.exception.location)})