Explorar o código

Update Websocket.php

walkor %!s(int64=3) %!d(string=hai) anos
pai
achega
a7b18972ae
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/Protocols/Websocket.php

+ 4 - 1
src/Protocols/Websocket.php

@@ -371,12 +371,15 @@ class Websocket implements \Workerman\Protocols\ProtocolInterface
             if (isset($connection->headers)) {
                 if (\is_array($connection->headers)) {
                     foreach ($connection->headers as $header) {
-                        if (\strpos($header, 'Server:') === 0) {
+                        if (\stripos($header, 'Server:') === 0) {
                             $has_server_header = true;
                         }
                         $handshake_message .= "$header\r\n";
                     }
                 } else {
+                    if (\stripos($connection->headers, 'Server:') !== false) {
+                        $has_server_header = true;
+                    }
                     $handshake_message .= "$connection->headers\r\n";
                 }
             }