Ver código fonte

response 413 when package reach max size

walkor 4 anos atrás
pai
commit
90f9e654b9
1 arquivos alterados com 4 adições e 0 exclusões
  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;
         }