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

reply: remove content-length when Transfer-Encoding is added #3814

Merged
merged 1 commit into from Apr 2, 2022

Conversation

xtx1130
Copy link
Contributor

@xtx1130 xtx1130 commented Apr 2, 2022

A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field.

Due to https://tools.ietf.org/html/rfc7230#section-3.3.2

Checklist

@climba03003
Copy link
Member

climba03003 commented Apr 2, 2022

If my understanding is correct, when Transfer-Encoding: chunked is exist, it will ignore the Content-Length header by default.

After testing, it is actually not.

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

Great catch!
Just a bit :)

// < 200.
// < 200
// A sender MUST NOT send a Content-Length header field in any message
// that contains a Transfer-Encoding header field.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// that contains a Transfer-Encoding header field.
// that contains a Transfer-Encoding header field.
// See: https://tools.ietf.org/html/rfc7230#section-3.3.2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This url has been added at the first line of this code comments

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the backport 3.x Issue or pr that should be backported to Fastify v3 label Apr 2, 2022
@mcollina mcollina merged commit edbb820 into fastify:main Apr 2, 2022
@mcollina
Copy link
Member

mcollina commented Apr 2, 2022

Can you send a backport PR to v3.x? It did not update automatically

@mcollina
Copy link
Member

mcollina commented Apr 2, 2022

Actually no need!

@mcollina mcollina mentioned this pull request Apr 2, 2022
4 tasks
@xtx1130
Copy link
Contributor Author

xtx1130 commented Apr 2, 2022

@climba03003 Thanks for your rebase

mcollina pushed a commit that referenced this pull request Apr 4, 2022
* feat: reply trailers support (#3794)

* chore: remove content-length when Transfer-Encoding is added (#3814)

Co-authored-by: 小菜 <xtx1130@gmail.com>
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport 3.x Issue or pr that should be backported to Fastify v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants