소스 검색

Content-Length 匹配存在bug

问号只匹配一个数字,不是完整的 Content-Length 长度
Anew_G. 11 년 전
부모
커밋
a6d16e3be8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      workerman/Common/Protocols/Http/Http.php

+ 2 - 2
workerman/Common/Protocols/Http/Http.php

@@ -21,7 +21,7 @@ function http_input($http_string)
     {
         // 找Content-Length
         $match = array();
-        if(preg_match("/\r\nContent-Length: ?(\d?)\r\n/", $http_string, $match))
+        if(preg_match("/\r\nContent-Length: ?(\d*)\r\n/", $http_string, $match))
         {
             $content_lenght = $match[1];
         }
@@ -481,4 +481,4 @@ class HttpCache
         }
         @\session_start();
     }
-}
+}