coap_ws: accept longer header lines and specific header sent by firefox browser

This commit is contained in:
Mario Kicherer authored and Jon Shallow committed 2024-08-23 10:39:17 +01:00
1 parent 3d790a5964
commit 8899063a4a
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -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 */
+2 -1
View File
@@ -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;
}