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

JMAP Websocket: server should return Sec-WebSocket-Protocol: jmap header? #5269

Closed
quantranhong1999 opened this issue Sep 17, 2024 · 2 comments
Assignees
Labels

Comments

@quantranhong1999
Copy link
Member

quantranhong1999 commented Sep 17, 2024

Why

@tddang-linagora tried to follow JMAP websocket specs cf https://www.rfc-editor.org/rfc/rfc8887.html#name-handshake.

He want to initiate the websocket connection and put in the first HTTP request the Sec-WebSocket-Protocol: jmap header and Postman return Error: Server sent no subprotocol.

Likely Postman validated that there was no Sec-WebSocket-Protocol: jmap header in the response.

Image

From the specs:
Otherwise, the client MUST make an [authenticated HTTP request](https://www.rfc-editor.org/rfc/rfc8887.html#RFC7235) [[RFC7235](https://www.rfc-editor.org/rfc/rfc8887.html#RFC7235)] on the encrypted connection and MUST include the value "jmap" in the list of protocols for the "Sec-WebSocket-Protocol" header field. The reply from the server MUST also contain a corresponding "Sec-WebSocket-Protocol" header field with a value of "jmap" in order for a JMAP subprotocol connection to be established.

The word Otherwise seems vague to me as it makes me have the impression that the Sec-WebSocket-Protocol header usage is just optional/fallback. However, it seems that the header is common and our server should support that header.

How

James JMAP Websocket server should return the Sec-WebSocket-Protocol response header upon HTTP authenticated request.

And likely we should reject the request without the the Sec-WebSocket-Protocol header too.

DoD

Tests.

@chibenwa
Copy link
Member

Can we just open a small PR prior the sprint starts so that it don't remain unadressed too long?

@quantranhong1999 quantranhong1999 self-assigned this Sep 30, 2024
@quantranhong1999
Copy link
Member Author

apache#2426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants