Skip to content

Fix missing request context (cookies/headers) in WebSocket callbacks#3815

Open
i-murray wants to merge 1 commit into
plotly:devfrom
i-murray:fix/websocket-callback-request-context
Open

Fix missing request context (cookies/headers) in WebSocket callbacks#3815
i-murray wants to merge 1 commit into
plotly:devfrom
i-murray:fix/websocket-callback-request-context

Conversation

@i-murray

@i-murray i-murray commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Propagate cookies, headers, args, path, remote, and origin from the WebSocket handshake onto the callback context in create_ws_context, mirroring the HTTP path. This fixes auth helpers (e.g. dash_enterprise_auth.get_user_data) failing over the WebSocket transport because callback_context.cookies/headers were empty.

Closes #3814

Contributor Checklist

  • I have run the tests locally and they passed.
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

Propagate cookies, headers, args, path, remote, and origin from the WebSocket handshake onto the callback context in create_ws_context, mirroring the HTTP path. This fixes auth helpers (e.g. dash_enterprise_auth.get_user_data) failing over the WebSocket transport because callback_context.cookies/headers were empty.
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] WebSocket callbacks do not expose request cookies/headers on callback_context

2 participants