Skip to content

Commit

Permalink
coap_ws: accept longer header lines and specific header sent by firef…
Browse files Browse the repository at this point in the history
…ox browser
  • Loading branch information
anyc authored and mrdeep1 committed Aug 23, 2024
1 parent 3d790a5 commit 8899063
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 8899063

Please sign in to comment.