Skip to content

fix(transport): keep first value when a response repeats a header - #713

Merged
armando-rodriguez-cko merged 1 commit into
checkout:masterfrom
pcbeingused33:fix/duplicate-response-headers
Nov 20, 2026
Merged

armando-rodriguez-cko merged 1 commit into
checkout:masterfrom
pcbeingused33:fix/duplicate-response-headers

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

Reproduction: any 200 response that sends two Set-Cookie headers (local HttpServer in the new test).

Root cause. ApacheHttpClientTransport.performCall builds the response header map with Collectors.toMap(Header::getName, Header::getValue) and no merge function. A repeated header name throws IllegalStateException, which the generic catch turns into handleException, 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 public Map<String, String> contract is unchanged and the first value is kept.

Test. New ApacheHttpClientTransportDuplicateHeadersTest serves a 200 with two Set-Cookie headers and asserts status, body and header in both invokeSync and async invoke. 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.

@agent-wall-e

agent-wall-e Bot commented Nov 19, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:Single-line bug fix adds a merge function to an existing Collectors.toMap call without changing the method signature, adding new endpoints, persisting data, or crossing any trust boundary.

Operational gates

  • ✅ jira_ticket
  • ✅ independent_review

Files analysed: 2


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 19, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.
2.2.6_logical_extension — Single-line bug fix adds a merge function to an existing Collectors.toMap call without changing the method signature, adding new endpoints, persisting data, or crossing any trust boundary. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@armando-rodriguez-cko armando-rodriguez-cko self-assigned this Nov 20, 2026
@armando-rodriguez-cko

Copy link
Copy Markdown
Contributor

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.
@armando-rodriguez-cko
armando-rodriguez-cko force-pushed the fix/duplicate-response-headers branch from be0b4e2 to 1a670fd Compare November 20, 2026 12:49
@agent-wall-e

agent-wall-e Bot commented Nov 20, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:Single-line fix to an existing collector with no new endpoints, data classes, auth changes, or external integrations — purely function-preserving bug fix within an existing code path.

Operational gates

  • ✅ jira_ticket
  • ✅ independent_review

Files analysed: 2


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 20, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.
2.2.6_logical_extension — Single-line fix to an existing collector with no new endpoints, data classes, auth changes, or external integrations — purely function-preserving bug fix within an existing code path. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

Copy link
Copy Markdown

@agent-wall-e agent-wall-e Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved — this PR meets all Low-risk criteria.

All checks passed, no unresolved comments, and the change classification is:

  • no_low_class_matched
  • prod_source_modified
  • 2.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…

@armando-rodriguez-cko
armando-rodriguez-cko merged commit d647113 into checkout:master Nov 20, 2026
3 of 4 checks passed
armando-rodriguez-cko pushed a commit that referenced this pull request Nov 20, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants