Hi @Jan Vávra,
You're right that HTTP/1.1 allows chunked transfer encoding. However, IIS does not currently support chunked request bodies for incoming requests. When such a request is received, IIS passes it to the FastCGI handler (like php-cgi.exe
), which may not handle it correctly.
This can result in the request not completing as expected. IIS does not reject the request with a 400 error because it doesn't detect the chunked body as invalid.
Why doesn't IIS return a 400 Bad Request?
Because IIS doesn't detect the request. So, it doesn't know that it's supposed to reject chunked requests. It just silently passes them onto PHP, which hangs.
Can IIS be configured to accept chunked request bodies?
At this time, there is no built-in support in IIS for handling chunked request bodies. Configuration options are limited, especially when using PHP with FastCGI.
Workarounds:
- Avoid chunked uploads by configuring the client to send a
Content-Length
header instead. - Adjust FastCGI settings like
requestTimeout
andactivityTimeout
to reduce the impact of long-running processes. See: FastCGI settings in IIS - Consider alternative platforms such as Linux with nginx or Apache if chunked uploads are required.