Skip to content

Commit 409fc90

Browse files
jean-shVincent, Jean
andauthored
[fix] Fix "Location" header access: convert the list of tuples to a dictionary for correct access (#21)
Co-authored-by: Vincent, Jean <[email protected]>
1 parent dbc0d0a commit 409fc90

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

django_saml2_auth/views.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,7 @@ def signin(request: HttpRequest):
172172
saml_client = get_saml_client(get_assertion_url(request), acs)
173173
_, info = saml_client.prepare_for_authenticate(relay_state=next_url)
174174

175-
redirect_url = None
176-
177-
if "Location" in info["headers"]:
178-
redirect_url = info["headers"]["Location"]
179-
175+
redirect_url = dict(info["headers"]).get("Location", "")
180176
return HttpResponseRedirect(redirect_url)
181177

182178

0 commit comments

Comments
 (0)