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

Read-Only functionality for HTTP::Headers #8712

Open
repomaa opened this issue Jan 23, 2020 · 1 comment
Open

Read-Only functionality for HTTP::Headers #8712

repomaa opened this issue Jan 23, 2020 · 1 comment
Labels
good first issue This is an issue suited for newcomers to become aquianted with working on the codebase. help wanted This issue is generally accepted and needs someone to pick it up kind:feature status:accepted topic:stdlib

Comments

@repomaa
Copy link
Contributor

repomaa commented Jan 23, 2020

As soon as the response body receives a write call, the response headers are written to the socket. It says as much in the docs.

This is a suggestion that, in my opinion, would save a lot of devs from headache:

As soon as the response body is written the headers are set into a read-only mode, after which setting headers will raise exceptions.

I had a hard time debugging why it looks like i've set the correct response headers but none of them is sent to the client. This is increasingly hard when using web frameworks that handle the request life cycle for you.

@rdp
Copy link
Contributor

rdp commented Mar 2, 2020

Seems well received, PR encouraged! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This is an issue suited for newcomers to become aquianted with working on the codebase. help wanted This issue is generally accepted and needs someone to pick it up kind:feature status:accepted topic:stdlib
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants