From 030f82d011247481a3adb3208980ff94d9bca8ec Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 20 Jan 2021 15:44:42 +0100 Subject: [PATCH 1/2] Decode headers before creating transaction --- sentry_sdk/integrations/asgi.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sentry_sdk/integrations/asgi.py b/sentry_sdk/integrations/asgi.py index 6bd1c146a0..192ad5a09b 100644 --- a/sentry_sdk/integrations/asgi.py +++ b/sentry_sdk/integrations/asgi.py @@ -130,8 +130,7 @@ async def _run_app(self, scope, callback): if ty in ("http", "websocket"): transaction = Transaction.continue_from_headers( - dict(scope["headers"]), - op="{}.server".format(ty), + self._get_headers(scope), op="{}.server".format(ty), ) else: transaction = Transaction(op="asgi.server") From daf42f25c62209e7952c39969166cea74d41ffed Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 20 Jan 2021 15:57:06 +0100 Subject: [PATCH 2/2] Formatting with new version of black --- sentry_sdk/integrations/asgi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/asgi.py b/sentry_sdk/integrations/asgi.py index 192ad5a09b..cfe8c6f8d1 100644 --- a/sentry_sdk/integrations/asgi.py +++ b/sentry_sdk/integrations/asgi.py @@ -130,7 +130,8 @@ async def _run_app(self, scope, callback): if ty in ("http", "websocket"): transaction = Transaction.continue_from_headers( - self._get_headers(scope), op="{}.server".format(ty), + self._get_headers(scope), + op="{}.server".format(ty), ) else: transaction = Transaction(op="asgi.server")