Skip to content

Commit

Permalink
Merge pull request #26 from jwaschkau/jwaschkau-patch-1
Browse files Browse the repository at this point in the history
fix initial request method signaling
  • Loading branch information
jwaschkau authored Nov 4, 2024
2 parents c789163 + c25bf70 commit 061dce0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions django_unpoly/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ def __call__(self, request):
request.is_unpoly = 'X-Up-Version' in request.headers

response: HttpResponseBase = self.get_response(request)

response["X-Up-Method"] = request.method

# Redirect detection for IE11
response["X-Up-Location"] = request.get_full_path()

# Signaling the initial request method
if request.method == 'GET' and 'X-Up-Target' not in request:
# See https://unpoly.com/_up_method
if request.method != 'GET' and 'X-Up-Target' not in request:
response.set_cookie('_up_method', request.method)
else:
response.delete_cookie('_up_method')
Expand Down

0 comments on commit 061dce0

Please sign in to comment.