Skip to content

Conversation

@hdmunguia
Copy link

Raw headers added via addRaw() were not being sent in the response.
The writeHeaders() function only wrote parsed headers from headers.list()
but skipped headers from headers.rawList().

This fix adds a loop to write raw headers after the parsed headers.

  Raw headers added via addRaw() were not being sent in the response.
  The writeHeaders() function only wrote parsed headers from headers.list()
  but skipped headers from headers.rawList().

  This fix adds a loop to write raw headers after the parsed headers.
@hdmunguia
Copy link
Author

Fix: Send raw headers in HTTP response

Problem

Raw headers added via headers().addRaw() were not being sent in HTTP responses.

Root Cause

The writeHeaders() function in src/common/http.cc only wrote parsed headers from headers.list() but skipped
headers from headers.rawList().

Solution

Added a loop to write raw headers after the parsed headers, ensuring all headers (both parsed and raw) are
included in the response.

@kiplingw
Copy link
Member

kiplingw commented Oct 3, 2025

Thank you for your contribution, @hdmunguia. I'm going to discuss with my peers and we'll get back to you. In the mean time, please remember to bump the patch version.

@Tachi107
Copy link
Member

Tachi107 commented Oct 4, 2025

Hi! Could you please add a test case demonstrating the old behaviour, and how your patch fixes it? Thanks!

@hdmunguia
Copy link
Author

Test changes pushed. Confirmed test case fails if fix is commented out.

@kiplingw
Copy link
Member

kiplingw commented Oct 8, 2025

Test changes pushed. Confirmed test case fails if fix is commented out.

I think you forgot to push those changes, as I don't see the unit test or versioning changes.

  This test demonstrates that raw headers added via addRaw() are now
  correctly sent in HTTP responses. Without the fix, this test fails.
  With the fix, it passes.
@kiplingw
Copy link
Member

kiplingw commented Oct 8, 2025

You're still missing the versioning change previously discussed.

@hdmunguia
Copy link
Author

I've updated version.txt and pushed. I hope this is the proper process.

@kiplingw
Copy link
Member

kiplingw commented Oct 8, 2025

Unfortunately still not correct. Please read the documentation linked above since you've updated the implementation without adding or changing any interfaces.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants