Skip to content

Commit 02efbe6

Browse files
committed
Make asgi_scope headers access safe
1 parent 609e21a commit 02efbe6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/integrations/_asgi_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _get_headers(asgi_scope):
2121
Extract headers from the ASGI scope, in the format that the Sentry protocol expects.
2222
"""
2323
headers = {} # type: Dict[str, str]
24-
for raw_key, raw_value in asgi_scope["headers"]:
24+
for raw_key, raw_value in asgi_scope.get("headers", {}):
2525
key = raw_key.decode("latin-1")
2626
value = raw_value.decode("latin-1")
2727
if key in headers:

0 commit comments

Comments
 (0)