Return HTTP 403 for invalid Origin headers (#1353)

This commit is contained in:
Peter Alexander 2025-09-22 16:44:51 +01:00 • committed by GitHub
commit 7e93a9fc19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,6 +122,6 @@ class TransportSecurityMiddleware:
# Validate Origin header
origin = request.headers.get("origin")
if not self._validate_origin(origin):
return Response("Invalid Origin header", status_code=400)
return Response("Invalid Origin header", status_code=403)
return None