Skip to content

fix(cre): support http multi headers#21043

Merged
MStreet3 merged 19 commits intodevelopfrom
street_httpMultiHeaders
Feb 13, 2026
Merged

fix(cre): support http multi headers#21043
MStreet3 merged 19 commits intodevelopfrom
street_httpMultiHeaders

Conversation

@MStreet3
Copy link
Copy Markdown
Contributor

@MStreet3 MStreet3 commented Feb 5, 2026

Support the new MultiHeaders field so that HTTP action capability can send and receive multiple values per header (e.g. Set-Cookie, Via):

  • Upgrades chainlink-common to v0.10.0 and cre-sdk-go to v1.3.0, which add MultiHeaders to gateway/capability HTTP types.
  • Adds MultiHeaders to HTTPRequest and HTTPResponse; use helpers to map to/from net/http.Header, preserve multiple values in responses, and keep comma-joined Headers for backward compatibility.
  • Forwards MultiHeaders on outbound requests and include MultiHeaders in outbound responses so the HTTP capability uses multi-value headers end to end.
  • Adds gateway tests for MultiHeaders (Set-Cookie, Via) and backward compatibility; extend CRE v2 HTTP action tests and fake server for multi-headers and regression.

Requires

Supports

@trunk-io

This comment was marked as outdated.

chudilka1
chudilka1 previously approved these changes Feb 13, 2026
chudilka1
chudilka1 previously approved these changes Feb 13, 2026
@cl-sonarqube-production
Copy link
Copy Markdown

for _, testCase := range httpActionSuccessTests {
if testCase.testCase == multiHeadersTestCase {
err = fake.Func("GET", testCase.endpoint, func(c *gin.Context) {
for name, values := range c.Request.Header {
Copy link
Copy Markdown
Contributor Author

@MStreet3 MStreet3 Feb 13, 2026

Choose a reason for hiding this comment

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

for the multiheader case, return any headers sent with the request on the response and write multiple cookies

if !statusOK(resp1.StatusCode) {
return "", fmt.Errorf("HTTP Action multi-headers (Headers request) status: %d", resp1.StatusCode)
}
h := resp1.GetHeaders() //nolint:staticcheck
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we also assert resp1.GetMultiHeaders() here?

if !statusOK(resp2.StatusCode) {
return "", fmt.Errorf("HTTP Action multi-headers (MultiHeaders request) status: %d", resp2.StatusCode)
}
mh := resp2.GetMultiHeaders()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we also assert resp2.GetHeaders() here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants