Skip to content

Commit 4425867

Browse files
authored
Merge pull request #26 from noureentaj/feature/content-type-validation
2 parents ebf4666 + 7614fdf commit 4425867

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jwt_signature_validator/encoded_payload.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ async def verify_signature():
8484
return {"type": receive_["type"], "body": signature, "more_body": False}
8585

8686
headers = MutableHeaders(scope=scope)
87-
if headers.get("Content-Type") == "application/json":
87+
if headers.get("Content-Type") is None:
88+
raise HTTPException(status_code=406, detail="Unacceptable Content Type!")
89+
elif headers.get("Content-Type") == "application/json":
8890
host = headers.get("host", "").split(":")[0]
8991
is_protected_host = False
9092
for pattern in self.protect_hosts:

0 commit comments

Comments
 (0)