Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compression http header request/response #1873

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

kozlovic
Copy link
Member

@kozlovic kozlovic commented Feb 1, 2021

The issue was introduced by PR #1858.

Key points:

  • Sec-WebSocket-Extensions must contain approved headers, so moving
    the "no-masking" private extension to its own header "Nats-No-Masking".

  • The format of the permessage-deflate negotiation response became
    invalid, I have fixed that.

  • For leaf nodes, if permessage-deflate extension is not at all
    present in the response, then simply disable compression, however
    if it is present but there is no server/client no context take over,
    then we have to fail the connection.

  • A leafnode test was not setting the "NoMasking" option so the
    test TestLeafNodeWSNoMaskingRejected was not capturing possible
    error if negotiation failed.

Signed-off-by: Ivan Kozlovic ivan@synadia.com

The issue was introduced by PR #1858.

Key points:

- Sec-WebSocket-Extensions must contain approved headers, so moving
the "no-masking" private extension to its own header "Nats-No-Masking".

- The format of the permessage-deflate negotiation response became
invalid, I have fixed that.

- For leaf nodes, if `permessage-deflate` extension is not at all
present in the response, then simply disable compression, however
if it is present but there is no server/client no context take over,
then we have to fail the connection.

- A leafnode test was not setting the "NoMasking" option so the
test TestLeafNodeWSNoMaskingRejected was not capturing possible
error if negotiation failed.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@kozlovic kozlovic requested a review from aricart February 1, 2021 19:25
Copy link
Member

@aricart aricart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kozlovic kozlovic merged commit c9c9bee into master Feb 1, 2021
@kozlovic kozlovic deleted the fix_websocket_compression branch February 1, 2021 20:51
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.

None yet

3 participants