Explorar o código

response 413 when package reach max size

walkor %!s(int64=4) %!d(string=hai) anos
pai
achega
90f9e654b9
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;
         }