diff --git a/aiohttp/web_exceptions.py b/aiohttp/web_exceptions.py index ad1728002a9..4d205299126 100644 --- a/aiohttp/web_exceptions.py +++ b/aiohttp/web_exceptions.py @@ -163,8 +163,8 @@ def __init__(self, raise ValueError("HTTP redirects need a location to redirect to.") super().__init__(headers=headers, reason=reason, body=body, text=text, content_type=content_type) - self.location = URL(location) - self.headers['Location'] = str(self.location) + self.headers['Location'] = str(URL(location)) + self.location = location class HTTPMultipleChoices(_HTTPMove):