Skip to content

Commit

Permalink
Fix header value check and add header to test
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttrinh committed Mar 5, 2024
1 parent 22a48cd commit 794d31e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion edb/server/protocol/auth_ext/http.py
Expand Up @@ -873,7 +873,7 @@ async def handle_magic_link_register(self, request: Any, response: Any):
test_mode=self.test_mode,
)

request_accepts_json: bool = request.accept == "application/json"
request_accepts_json: bool = request.accept == b"application/json"

if not request_accepts_json and not maybe_redirect_to:
raise errors.InvalidData(
Expand Down
5 changes: 4 additions & 1 deletion tests/test_http_ext_auth.py
Expand Up @@ -3837,7 +3837,10 @@ async def test_http_auth_ext_magic_link_01(self):
"redirect_on_failure": redirect_on_failure,
}
).encode(),
headers={"Content-Type": "application/json"},
headers={
"Content-Type": "application/json",
"Accept": "application/json",
},
)
self.assertEqual(status, 200)

Expand Down

0 comments on commit 794d31e

Please sign in to comment.