Repository navigation
fix(transport): keep first value when a response repeats a header - #713
Conversation
🟢 Risk Classification: LOWApproval route: AI Auto-Approval Classification reasons
Operational gates
Files analysed: 2 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
Thank you very much for the contribution and for the clear reproduction! We'll review it shortly. |
Collectors.toMap without a merge function threw IllegalStateException on repeated response headers such as Set-Cookie; the catch block then replaced the real HTTP response with the configured error status.
be0b4e2 to
1a670fd
Compare
🟢 Risk Classification: LOWApproval route: AI Auto-Approval Classification reasons
Operational gates
Files analysed: 2 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
There was a problem hiding this comment.
✅ Auto-approved — this PR meets all Low-risk criteria.
All checks passed, no unresolved comments, and the change classification is:
no_low_class_matchedprod_source_modified2.2.6_logical_extension:Single-line fix adds a merge function to an existing Collectors.toMap call, preserving the same Map<String,String> contract without new endpoints, auth changes, persisted data, or external integrations.
wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…
This release brings security hardening of request building, the OAuth client and request logging, and fixes responses that repeat a header. Custom base URIs and the OAuth authorization URI are now validated when the SDK is built, so check them before upgrading if you set them. No public member is removed; one constructor is added. **Added** * `CheckoutAuthorizationException(String, Throwable)` (#711). **Changed** * Security hardening (#707, #709, #711). * Path values that cannot be sent as one path segment (null, empty, `.`, `..`, or containing "/" or "\") raise `CheckoutArgumentException` before the request is sent. For `CustomersClient#get` with an email that contains "/" or "\", pass the customer ID instead (#707, #709). * Custom base URIs (`CustomEnvironment`, or a custom `UriStrategy` given to `ApiClientImpl`) are validated when the SDK is built, every setting included. An invalid one fails `build()` with a `CheckoutArgumentException` that names the setting. Use absolute `http` or `https` URIs with a host, ending with "/" when they have a path, as described in the README Custom Environment section (#709). * The OAuth authorization URI must be an absolute `https` URI with an ASCII host written without percent-encoding, no user information and an optional port from 1 to 65535; `http` is accepted only for `localhost`, `127.0.0.0/8` and `[::1]`. Any other URI throws `CheckoutArgumentException` when the SDK is built (#711). * OAuth token request failures and token responses that cannot be used raise `CheckoutAuthorizationException`, a subclass of `CheckoutException`. Catch `CheckoutException` or `CheckoutAuthorizationException` (#711). * The request and response log lines hold less information (#711). **Fixed** * A response that repeats a header (for example two `Set-Cookie` headers) is no longer reported as a 400; the first value is kept (#713). * With a custom base URI that has a path, iDEAL requests stay under that path like every other request (#707).



Reproduction: any 200 response that sends two
Set-Cookieheaders (localHttpServerin the new test).Root cause.
ApacheHttpClientTransport.performCallbuilds the response header map withCollectors.toMap(Header::getName, Header::getValue)and no merge function. A repeated header name throwsIllegalStateException, which the genericcatchturns intohandleException, so a successful HTTP 200 is replaced by the configured default error status and the body is lost.Fix. Add a merge function
(first, ignored) -> first, so the publicMap<String, String>contract is unchanged and the first value is kept.Test. New
ApacheHttpClientTransportDuplicateHeadersTestserves a 200 with twoSet-Cookieheaders and asserts status, body and header in bothinvokeSyncand asyncinvoke. It fails 2/2 before the change and passes after; the existing transport tests still pass.Disclosure: this change was prepared with the assistance of an AI coding tool (Claude Code) and submitted by the account owner.