JDK-8293574 : HttpClient mishandles HTTP 1xx status codes as final response messages
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 11,17,18,19,20
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2022-09-08
  • Updated: 2022-09-09
  • Resolved: 2022-09-09
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
See <https://github.com/greenbytes/java-http-1xx-tests>.

HttpClient treats HTTP 1xx response messages as final, instead of waiting for a message with status code >= 200.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
git clone git@github.com:greenbytes/java-http-1xx-tests.git
mvn clean install -Dtest=JavaNetHttpHttpClientTests


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Tests should pass.
ACTUAL -
Tests fail with the informational response handled as final (FWIW, HTTPURLConnection has the same bug, reported in 2016: https://bugs.openjdk.org/browse/JDK-8170305)

FREQUENCY : always



Comments
Please convey my thanks to the reporter for coming up with the test cases reproducing this issue. A fix for this issue was already in progress and under review. I ran the tests provided by the reporter against that proposed fix and one specific test continued to fail. I looked deeper and that helped me identify an issue in the proposed fix where the response code 100 needed some additional work. I've now addressed that part in the fix.
09-09-2022

Duplicate of https://bugs.openjdk.org/browse/JDK-8292044
09-09-2022

This issue with HttpClient is being addressed as part of https://bugs.openjdk.org/browse/JDK-8292044. I'll mark this current issue as a duplicate of the other one.
09-09-2022

The observations on Windows 10: JDK 11: Failed, tests failed. JDK 17: Failed. JDK 18: Failed. JDK 19ea+22: Failed. JDK 20ea+4: Failed.
09-09-2022