浏览代码

response 413 when package reach max size

walkor 4 年之前
父节点
当前提交
90f9e654b9
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Protocols/Http.php

+ 4 - 0
Protocols/Http.php

@@ -145,6 +145,10 @@ class Http
                     unset($input[key($input)]);
                 }
             }
+            if ($length > $connection->maxPackageSize) {
+                $connection->close("HTTP/1.1 413 Request Entity Too Large\r\n\r\n");
+                return 0;
+            }
             return $length;
         }