Skip to content

Allow WebSocket extension negotiation to be disabled per response (#17030) - #17036

Merged
normanmaurer merged 1 commit into
5.0from
ws5
Jul 2, 2026
Merged

normanmaurer merged 1 commit into
5.0from
ws5

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

Frameworks may install WebSocketServerExtensionHandler globally in the
server pipeline, but still need to decline WebSocket extension
negotiation for a specific accepted WebSocket response.

One example is a framework-level WebSocket API where compression is
enabled globally, but an individual WebSocket endpoint chooses to
disable compression. The server should still accept the WebSocket
upgrade and exchange plain WebSocket frames; it should only omit the
negotiated extension response header and avoid installing extension
encoder/decoder handlers for that response.

Modification:

Add a response marker that lets WebSocketServerExtensionHandler skip
extension negotiation for that response.

Add coverage verifying that the upgrade response is forwarded without
negotiating extensions when the marker is present.

Result:

Applications and frameworks can decide per WebSocket response whether
negotiated extensions should be accepted, without adding private headers
or removing the extension handler from the pipeline.

Co-authored-by: Norman Maurer [email protected]

…7030)

Motivation:

Frameworks may install `WebSocketServerExtensionHandler` globally in the
server pipeline, but still need to decline WebSocket extension
negotiation for a specific accepted WebSocket response.

One example is a framework-level WebSocket API where compression is
enabled globally, but an individual WebSocket endpoint chooses to
disable compression. The server should still accept the WebSocket
upgrade and exchange plain WebSocket frames; it should only omit the
negotiated extension response header and avoid installing extension
encoder/decoder handlers for that response.

Modification:

Add a response marker that lets `WebSocketServerExtensionHandler` skip
extension negotiation for that response.

Add coverage verifying that the upgrade response is forwarded without
negotiating extensions when the marker is present.

Result:

Applications and frameworks can decide per WebSocket response whether
negotiated extensions should be accepted, without adding private headers
or removing the extension handler from the pipeline.

Co-authored-by: Norman Maurer <[email protected]>
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Jul 2, 2026
@normanmaurer
normanmaurer merged commit a0d62cd into 5.0 Jul 2, 2026
13 checks passed
@normanmaurer
normanmaurer deleted the ws5 branch July 2, 2026 09:15
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.

2 participants