We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8988faf + 00be8c7 commit 73faf7eCopy full SHA for 73faf7e
src/WebSocketsClient.cpp
@@ -397,9 +397,12 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
397
"Connection: Upgrade\r\n"
398
"User-Agent: arduino-WebSocket-Client\r\n"
399
"Sec-WebSocket-Version: 13\r\n"
400
- "Sec-WebSocket-Protocol: " + client->cProtocol +"\r\n"
401
"Sec-WebSocket-Key: " + client->cKey + "\r\n";
402
+ if(client->cProtocol.length() > 0) {
403
+ handshake += "Sec-WebSocket-Protocol: " + client->cProtocol + "\r\n";
404
+ }
405
+
406
if(client->cExtensions.length() > 0) {
407
handshake += "Sec-WebSocket-Extensions: " + client->cExtensions + "\r\n";
408
}
0 commit comments