Ver Fonte

Update Websocket.php

walkor há 3 anos atrás
pai
commit
a7b18972ae
1 ficheiros alterados com 4 adições e 1 exclusões
  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";
                 }
             }