eclipse-ee4j / grizzly

Grizzly
https://eclipse-ee4j.github.io/grizzly
Other
147 stars 68 forks source link

No HTTP 100 intermediate response for POST with chunked transfer encoding #2174

Closed tobiasfriedrich closed 11 months ago

tobiasfriedrich commented 2 years ago

When sending a POST request with "Expect: 100-continue" and "Transfer-Encoding: chunked" to the server, it is not acknowledged with a HTTP 100 interim response. This causes requests timing out for clients that rely on receiving the HTTP 100 status prior the actual request payload is transferred.

The following script demonstrates the problem:

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "localhost:8009",
    CURLOPT_VERBOSE => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_EXPECT_100_TIMEOUT_MS => 90000,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "test=test",
    CURLOPT_HTTPHEADER => array(
      "Content-Type: application/x-www-form-urlencoded",
      "Transfer-Encoding: chunked",
      "Expect: 100-continue"
    )
  )
);
curl_exec($curl);
curl_close($curl);
?>

We're still using grizzly-http-all-2.4.4.jar - but likely the v3.x and v4.x / release streams are affected as well.