Przeglądaj źródła

Update Websocket.php

walkor 3 lat temu
rodzic
commit
a7b18972ae
1 zmienionych plików z 4 dodań i 1 usunięć
  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";
                 }
             }