Visitar URL original
Java11 Http2Client loses response header value order and duplicate occurrences · Issue #3636 · OpenFeign/feign · GitHub
Skip to content

Java11 Http2Client loses response header value order and duplicate occurrences #3636

Open

Description

@hutiefang76

The Java11 client converts each list of response header values to a HashSet in castMapCollectType, losing repeated occurrences and their received order. Both synchronous and asynchronous callers see the changed values through Response.headers().

I reproduced this on current master (fee42b4) against a real local MockWebServer, adding each value as a separate header line. Six cases fail across sync/async execution: ordered distinct values, repeated identical Set-Cookie values, and mixed distinct/duplicate values. Both single-value controls pass; there are no test errors or skips.

For example, sending two identical Set-Cookie: session=abc; Path=/ lines returns only one value in response.headers().get("set-cookie").

JDK HttpHeaders preserves each occurrence and the received order of response header values. Feign's core header copy and the OkHttp/Apache HTTP5 adapters also preserve the lists. I am preparing a small list-preserving conversion fix with the real HTTP regression tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions