Skip to content

Commit

Permalink
django-unpoly-10 django-unpoly-9 X-Up-Method Header does not work wit…
Browse files Browse the repository at this point in the history
…h post redirects
  • Loading branch information
Jannik Eilers committed Aug 4, 2021
1 parent 8977779 commit edc8f54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions django_unpoly/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def _handle_redirect_headers(self, response: HttpResponseBase):
Preserves Unpoly X-Up-Headers over redirects by adding them as GET parameters
See https://github.com/jwaschkau/django-unpoly/issues/4
"""
if not hasattr(response, 'url'):
# Some responses do not have a url e.g. HttpResponseNotModified
return
response['X-Up-Location'] = response.url # Report the original url to Unpoly
params = {}
for header, value in self._get_up_headers(response):
Expand Down

0 comments on commit edc8f54

Please sign in to comment.