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

websockets: accept longer header lines and specific header sent by firefox browser #1504

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/coap3/coap_ws_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct coap_ws_state_t {
uint8_t rd_header[COAP_MAX_FS]; /**< (Partial) frame */
uint8_t mask_key[4]; /**< Masking key */
uint32_t http_ofs; /**< Current offset into http_hdr */
uint8_t http_hdr[80]; /**< (Partial) HTTP header */
uint8_t http_hdr[160]; /**< (Partial) HTTP header */
size_t data_ofs; /**< Offset into user provided buffer */
size_t data_size; /**< Data size as indicated by WebSocket frame */
uint8_t key[16]; /**< Random, but agreed key value */
Expand Down
3 changes: 2 additions & 1 deletion src/coap_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ coap_ws_rd_http_header_server(coap_session_t *session) {
coap_log_debug("WS: Duplicate Connection: header\n");
return 0;
}
if (strcasecmp(value, "Upgrade") != 0) {
if (strcasecmp(value, "Upgrade") != 0 &&
strcasecmp(value, "keep-alive, Upgrade") != 0) {
coap_log_debug("WS: Invalid Connection: header\n");
return 0;
}
Expand Down