Skip to content

always update thrift header write list in headerbp client middleware#685

Merged
pacejackson merged 2 commits intoreddit:masterfrom
pacejackson:headerbp-thrift-fix
Feb 20, 2025
Merged

always update thrift header write list in headerbp client middleware#685
pacejackson merged 2 commits intoreddit:masterfrom
pacejackson:headerbp-thrift-fix

Conversation

@pacejackson
Copy link
Copy Markdown
Contributor

💸 TL;DR

This is really just to make the code cleaner since it technically works because thrift.GetWriteHeaderList returns the underlying list, not a copy, and slices.Delete deletes from the source slice. I think the code is a lot clearer and less likely to have a bug later if we always set the outgoing header list.

I verified this by adding a test case. The test passes without my changes, but it fails if I copy outgoing before deleting the headers from it.

@pacejackson pacejackson requested a review from a team as a code owner February 19, 2025 22:01
@pacejackson pacejackson requested review from fishy, konradreiche and kylelemons and removed request for a team February 19, 2025 22:01
@pacejackson pacejackson merged commit ddd6634 into reddit:master Feb 20, 2025
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.

3 participants