Skip to content

Commit a7b4144

Browse files
authored
Don't fail when upstream scheme is unusual (#2371)
See #2370
1 parent 9bbd480 commit a7b4144

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
@@ -43,7 +43,7 @@ def _get_url(asgi_scope, default_scheme, host):
4343

4444
if server is not None:
4545
host, port = server
46-
default_port = {"http": 80, "https": 443, "ws": 80, "wss": 443}[scheme]
46+
default_port = {"http": 80, "https": 443, "ws": 80, "wss": 443}.get(scheme)
4747
if port != default_port:
4848
return "%s://%s:%s%s" % (scheme, host, port, path)
4949
return "%s://%s%s" % (scheme, host, path)

0 commit comments

Comments
 (0)