@@ -272,25 +272,22 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
272
272
273
273
unsigned long start = micros ();
274
274
275
- String handshake;
276
- handshake=" GET " +client->cUrl +" HTTP/1.1\r\n " ;
277
- handshake+=" Host: " +_host+" \r\n " ;
278
- handshake+=" Upgrade: websocket\r\n " ;
279
- handshake+=" Connection: Upgrade\r\n " ;
280
- handshake+=" User-Agent: arduino-WebSocket-Client\r\n " ;
281
- handshake+=" Sec-WebSocket-Version: 13\r\n " ;
282
- handshake+=" Sec-WebSocket-Protocol: arduino\r\n " ;
283
- handshake+=" Sec-WebSocket-Key: " +client->cKey +" \r\n " ;
284
-
285
- if (client->cExtensions .length () > 0 ) {
286
- handshake+=" Sec-WebSocket-Extensions: " +client->cExtensions +" \r\n " ;
275
+ String handshake = " GET " + client->cUrl + " HTTP/1.1\r\n "
276
+ " Host: " + _host + " \r\n "
277
+ " Upgrade: websocket\r\n "
278
+ " Connection: Upgrade\r\n "
279
+ " User-Agent: arduino-WebSocket-Client\r\n "
280
+ " Sec-WebSocket-Version: 13\r\n "
281
+ " Sec-WebSocket-Protocol: arduino\r\n "
282
+ " Sec-WebSocket-Key: " + client->cKey + " \r\n " ;
283
+
284
+ if (client->cExtensions .length () > 0 ) {
285
+ handshake += " Sec-WebSocket-Extensions: " + client->cExtensions + " \r\n " ;
287
286
}
288
-
289
- handshake+=" \r\n " ;
290
- client->tcp .write (handshake.c_str (), handshake.length ());
291
287
292
- DEBUG_WEBSOCKETS ( " [WS-Client][sendHeader] sending header... Done (%uus). \n " , ( micros () - start)) ;
288
+ handshake += " \r\n " ;
293
289
290
+ client->tcp .write (handshake.c_str (), handshake.length ());
294
291
295
292
DEBUG_WEBSOCKETS (" [WS-Client][sendHeader] sending header... Done (%uus).\n " , (micros () - start));
296
293
0 commit comments