RFR: 8351347: HttpClient Improve logging of response headers

Volkan Yazici vyazici at openjdk.org
Tue May 13 08:21:03 UTC 2025


Includes request method, request URI, response status code, and HTTP/2 stream ID while logging response headers in the HTTP Client.

### Demonstration

Snippets from running JTreg against `test/jdk/java/net/httpclient/HeadTest.java`:

**Before:**

INFO: HEADERS: RESPONSE HEADERS:
    connection: Upgrade
    upgrade: h2c
...
INFO: HEADERS: RESPONSE HEADERS:
    :status: 304
    content-length: 300


**After:** 

INFO: HEADERS: RESPONSE HEADERS:
  GET http://127.0.0.1:48497/ 101
    connection: Upgrade
    upgrade: h2c
...
INFO: HEADERS: RESPONSE HEADERS (streamid=1):
  GET http://127.0.0.1:48497/ 304
    :status: 304
    content-length: 300

-------------

Commit messages:
 - Improve HTTP response header logging

Changes: https://git.openjdk.org/jdk/pull/25201/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25201&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8351347
  Stats: 16 lines in 2 files changed: 14 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/25201.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25201/head:pull/25201

PR: https://git.openjdk.org/jdk/pull/25201


More information about the net-dev mailing list