Skip to content

greenbytes/java-http-1xx-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

java-http-1xx-tests

Tests for HTTP client support for informational (1xx) response messages, as defined in Section 15.2 of RFC 9110.

Clients minimally should ignore these messages and wait for a final message (non-1xx). Optimally, they would expose receipt of an 1xx to the client, so that it can process it early, without waiting for the final response.

We currently test with:

  • java.net.HttpURLConnection
  • java.net.http.HttpClient (JDK 11)
  • Apache HttpClient 4
  • Apache HttpClient 5
  • OkHttp

Test overview:

Client/Test 100 102 103 104 104 x 2 104 x 100 199 200 1xx receipts reported
java.net.HttpURLConnection (Java 8 .. 17) ✔️ ✔️
java.net.HttpURLConnection (Java 21) ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
java.net.http.HttpClient ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ (requires system property to be set to override the default limit of eight 1xx responses) ✔️ ✔️ ❌ (see https://bugs.openjdk.org/browse/JDK-8294196)
Apache HttpClient 4 ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Apache HttpClient 5 ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
OkHttp 4 ✔️ ✔️ ✔️ ✔️ ✔️ ✔️

Results:

Bug Reports:

Enhancement requests:

Fixes in JDKs:

java.net.HttpURLConnection java.net.http.HttpClient
JDK 8 ❌ JDK 8 ❌
JDK 11 ❌ JDK 11 ✔️ (as of 11.0.24)
JDK 17 ❌ JDK 17 ✔️ (as of 17.0.12)
JDK 21 ✔️ ✔️

Summary of currently defined 1xx codes

Note that although only few code points have been allocated (https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml), the default behavior for all codes except 100 and 101 is the same, so HTTP stacks can and should treat them uniformly.

100 Continue

https://www.rfc-editor.org/rfc/rfc9110.html#status.100

Special: in conjunction with https://www.rfc-editor.org/rfc/rfc9110.html#field.expect can be used to check that a request will be accepted by the server before sending the body.

101 Switching Protocols

https://www.rfc-editor.org/rfc/rfc9110.html#status.101

Special: for changing protocols; needs to be hard-wired into clients.

102 Processing

http://webdav.org/specs/rfc2518.html#STATUS_102

Designed for reporting progress for a long-running request; could be used by user-agent to keep the connection open and display progress.

103 Early Hints

https://www.rfc-editor.org/rfc/rfc8297.html

These reponses will contain "early hints", allowing a user-agent to start fetching related documents (for instance CSS) before the initial request is completed.

104 Upload Resumption Supported

https://www.ietf.org/archive/id/draft-ietf-httpbis-resumable-upload-09.html

Can be used to (a) indicate that resumable uploads are supported, and (b) to report progress. Note that specifically for this code, the intermediate response can appear many times.

About

Tests for HTTP client support for 1xx response messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages