Ver Fonte

Content-Length 匹配存在bug

问号只匹配一个数字,不是完整的 Content-Length 长度
Anew_G. há 11 anos atrás
pai
commit
a6d16e3be8
1 ficheiros alterados com 2 adições e 2 exclusões
  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();
     }
-}
+}