walkor 2 년 전
부모
커밋
1801549e1c
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/Protocols/Http.php

+ 2 - 2
src/Protocols/Http.php

@@ -124,14 +124,14 @@ class Http
         }
 
         $header = substr($buffer, 0, $crlfPos);
-        $hostHeaderPosition = strpos($header, "\r\nHost: ");
+        $hostHeaderPosition = stripos($header, "\r\nHost: ");
 
         if (false === $hostHeaderPosition && $firstLine[2] === "HTTP/1.1") {
             $connection->close("HTTP/1.1 400 Bad Request\r\n\r\n", true);
             return 0;
         }
 
-        if ($pos = strpos($header, "\r\nContent-Length: ")) {
+        if ($pos = stripos($header, "\r\nContent-Length: ")) {
             $length = $length + (int)substr($header, $pos + 18, 10);
             $hasContentLength = true;
         } else if (preg_match("/\r\ncontent-length: ?(\d+)/i", $header, $match)) {