Skip to content

Headers are not parsed correctly in ASGI middleware #983

@ericdevries

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

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