Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutable access to request headers #2187

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

itowlson
Copy link
Contributor

Fixes #2186.

This ended up being not symmetric with Request::headers() but I couldn't see a way to get closer (e.g. iter_mut() didn't seem like it would allow for inserts). It also surfaces the implementation in what feels like a rather raw way. @rylev Please feel free to close in favour of a better way if you have one, I'd love a learning opportunity!

@itowlson itowlson requested a review from rylev December 17, 2023 21:44
Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

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

The function was added to the Response type which I don't think was intended? In any case, would it be possible to use set_header instead of having mutable access to the headers collection?

@lann
Copy link
Collaborator

lann commented Dec 18, 2023

The function was added to the Response type which I don't think was intended? In any case, would it be possible to use set_header instead of having mutable access to the headers collection?

👍 for set_header to match the behavior of RequestBuilder::header

@itowlson
Copy link
Contributor Author

Well, doh. Thanks for the catch and guidance. Updated.

@itowlson itowlson requested a review from rylev December 18, 2023 18:46
@itowlson itowlson merged commit 49ba8fe into fermyon:main Dec 19, 2023
9 checks passed
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.

Mutate HTTP request headers
3 participants