Skip to content

Headers are not parsed correctly in ASGI middleware #983

Closed

Description

@ericdevries

The ASGI middleware seems to get the raw headers from the scope which are all in byte form. This is used to get/start a transaction, which does not see the sentry-trace header as it checks for the string version of that header.

See this line for the faulty part:
https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/asgi.py#L133

There is a method that parses the headers and turns it into a Dict[str, str] found here:
https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/asgi.py#L228

Activity

  1. untitaker commented on Jan 21, 2021

    @untitaker
    Member

    Fixed in #984, thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions