Skip to content

WebBrokerAPI: Move on_connection_init.response policy processing before WebSocket upgrade in WebBrokerApi receiver #1958

@coderabbitai

Description

@coderabbitai

Summary

In event-gateway/gateway-runtime/internal/connectors/receiver/websocket/broker_api_connector.go, the on_connection_init.response policy is currently applied after the WebSocket handshake (upgrader.Upgrade), and its output headers are discarded. This means any headers set by the response policy cannot influence the WebSocket handshake.

Expected Behavior

ProcessConnectionInitResponse should be called before upgrader.Upgrade, and the resulting headers from the processed message should be passed as the third argument to upgrader.Upgrade (instead of nil), so that handshake headers reflect policy output.

References

Requested by

@senthuran16

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions