Browse Source

response 413 when package reach max size

walkor 4 năm trước cách đây
mục cha
commit
90f9e654b9
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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;
         }