Explorar el Código

Remove forced ws client header 'Origin'.

This is not needed in common cases and may cause 4xx response.
The default value '*' is also invalid.
Ares hace 6 años
padre
commit
fe7f9c3078
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Protocols/Ws.php

+ 1 - 1
Protocols/Ws.php

@@ -383,7 +383,7 @@ class Ws
         (!preg_match("/\nHost:/i", $user_header_str) ? "Host: $host\r\n" : '').
         (!preg_match("/\nHost:/i", $user_header_str) ? "Host: $host\r\n" : '').
         "Connection: Upgrade\r\n".
         "Connection: Upgrade\r\n".
         "Upgrade: websocket\r\n".
         "Upgrade: websocket\r\n".
-        "Origin: ". (isset($connection->websocketOrigin) ? $connection->websocketOrigin : '*') ."\r\n".
+        (isset($connection->websocketOrigin) ? "Origin: ".$connection->websocketOrigin."\r\n":'').
         (isset($connection->WSClientProtocol)?"Sec-WebSocket-Protocol: ".$connection->WSClientProtocol."\r\n":'').
         (isset($connection->WSClientProtocol)?"Sec-WebSocket-Protocol: ".$connection->WSClientProtocol."\r\n":'').
         "Sec-WebSocket-Version: 13\r\n".
         "Sec-WebSocket-Version: 13\r\n".
         "Sec-WebSocket-Key: " . $connection->websocketSecKey . $user_header_str . "\r\n\r\n";
         "Sec-WebSocket-Key: " . $connection->websocketSecKey . $user_header_str . "\r\n\r\n";