mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-14 15:56:30 +02:00
Allow to disable "Origin" header
The origin header often makes trouble with current WebSocket implementations. Thus, we introduce the WEBSOCKET_HEADERS_NO_ORIGIN macro which disables this header it if defined.
This commit is contained in:
@ -479,8 +479,12 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
|
|||||||
handshake += WEBSOCKETS_STRING("Connection: keep-alive\r\n");
|
handshake += WEBSOCKETS_STRING("Connection: keep-alive\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
handshake += WEBSOCKETS_STRING("Origin: file://\r\n"
|
#ifndef WEBSOCKET_HEADERS_NO_ORIGIN
|
||||||
"User-Agent: arduino-WebSocket-Client\r\n");
|
// add origin header if requested
|
||||||
|
handshake += WEBSOCKETS_STRING("Origin: file://\r\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
handshake += WEBSOCKETS_STRING("User-Agent: arduino-WebSocket-Client\r\n");
|
||||||
|
|
||||||
if(client->base64Authorization.length() > 0) {
|
if(client->base64Authorization.length() > 0) {
|
||||||
handshake += WEBSOCKETS_STRING("Authorization: Basic ");
|
handshake += WEBSOCKETS_STRING("Authorization: Basic ");
|
||||||
|
Reference in New Issue
Block a user