8000 - Remove duplicate handshake headers · michkot/arduinoWebSockets@5cd68c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5cd68c5

Browse files
committed
- Remove duplicate handshake headers
- Add debug log for displaying handshake headers Host, Origin, and User-Agent were duplicated in the case the client was not socketIO or if it was and has a sessionId
1 parent ddaeea0 commit 5cd68c5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/WebSocketsClient.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,8 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
426426
transport = "&transport=websocket&sid=" + client->cSessionId;
427427
}
428428
handshake = "GET " + client->cUrl + transport + " HTTP/1.1\r\n"
429-
"Host: " + _host + ":" + _port + "\r\n"
430429
"Connection: Upgrade\r\n"
431430
"Upgrade: websocket\r\n"
432-
"Origin: file://\r\n"
433-
"User-Agent: arduino-WebSocket-Client\r\n"
434431
"Sec-WebSocket-Version: 13\r\n"
435432
"Sec-WebSocket-Key: " + client->cKey + "\r\n";
436433

@@ -460,7 +457,7 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
460457
}
461458

462459
handshake += "\r\n";
463-
460+
DEBUG_WEBSOCKETS("[WS-Client][sendHeader] handshake %s", handshake.c_str());
464461
client->tcp->write(handshake.c_str(), handshake.length());
465462

466463
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)

0 commit comments

Comments
 (0)
0