Skip to content

Conversation

@jasmine-nahrain
Copy link
Collaborator

@jasmine-nahrain jasmine-nahrain commented Oct 18, 2024

Prior to issue #9527, content-type header was being deleted and readded in merge_response_header_with_cached_header despite line 5005 specificaly stating that it should not be overwritten.

Once the issue was fixed, if duplicate headers were found and content-type was being sent after one of the duplicate headers, it would be deleted in the for loop at line 5038.
E.g.

HTTP/1.1 200 OK
x-reveal-duplicate: same
content-type: text/plain
x-reveal-duplicate: same

once the duplicate header is found, all headers subsequent to the dup are deleted. The intended course of this code is to then have those headers readded in the greater for loop. This works fine for most cases but because content-type is specified to not follow this behaviour, it is getting deleted but never readded.

This adds a secondary check for content-type to not be altered.

This fixes #11784

@jasmine-nahrain jasmine-nahrain self-assigned this Oct 18, 2024
@jasmine-nahrain jasmine-nahrain added this to the 10.1.0 milestone Oct 18, 2024
@jasmine-nahrain jasmine-nahrain marked this pull request as draft October 18, 2024 02:54
@jasmine-nahrain
Copy link
Collaborator Author

[approve ci autest]

@jasmine-nahrain
Copy link
Collaborator Author

[approve ci format]

@jasmine-nahrain
Copy link
Collaborator Author

[approve ci rat]

@jasmine-nahrain
Copy link
Collaborator Author

[approve ci centos]

@bryancall bryancall self-requested a review October 21, 2024 22:06
@bryancall bryancall added the HTTP label Oct 21, 2024
@jasmine-nahrain jasmine-nahrain marked this pull request as ready for review October 21, 2024 22:07
@maskit maskit merged commit 8671ddb into apache:master Oct 30, 2024
jasmine-nahrain added a commit to jasmine-nahrain/trafficserver that referenced this pull request Oct 30, 2024
* Fix for apache#11784

* Just specify content-type not be altered

* Update HttpTransact.cc

(cherry picked from commit 8671ddb)
bryancall pushed a commit that referenced this pull request Oct 31, 2024
* Fix for #11784

* Just specify content-type not be altered

* Update HttpTransact.cc

(cherry picked from commit 8671ddb)
@cmcfarlen cmcfarlen modified the milestones: 10.1.0, 10.0.2 Oct 31, 2024
@cmcfarlen
Copy link
Contributor

Cherry-picked to v10.0.x

cmcfarlen pushed a commit that referenced this pull request Oct 31, 2024
* Fix for #11784

* Just specify content-type not be altered

* Update HttpTransact.cc

(cherry picked from commit 8671ddb)
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request May 29, 2025
* Fix for apache#11784

* Just specify content-type not be altered

* Update HttpTransact.cc

(cherry picked from commit 8671ddb)
(cherry picked from commit 8f16f2d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Picked-10.0.2

Development

Successfully merging this pull request may close these issues.

Content-Type is lost after TCP_REFRESH_HIT/200 of cached response with duplicated headers from origin

4 participants