Skip to content

doc: fix example of content-length to correct value#43361

Merged
hamishwillee merged 5 commits intomdn:mainfrom
samuel871211:fixExampleContentLength
Mar 8, 2026
Merged

doc: fix example of content-length to correct value#43361
hamishwillee merged 5 commits intomdn:mainfrom
samuel871211:fixExampleContentLength

Conversation

@samuel871211
Copy link
Contributor

@samuel871211 samuel871211 commented Mar 7, 2026

Description

Motivation

Additional details

Related issues and pull requests

@samuel871211 samuel871211 requested a review from a team as a code owner March 7, 2026 07:50
@samuel871211 samuel871211 requested review from hamishwillee and removed request for a team March 7, 2026 07:50
@github-actions github-actions bot added Content:HTTP HTTP docs size/xs [PR only] 0-5 LoC changed labels Mar 7, 2026
@samuel871211 samuel871211 changed the title doc: fic example of content-length to correct value doc: fix example of content-length to correct value Mar 7, 2026
@samuel871211 samuel871211 force-pushed the fixExampleContentLength branch from aa76088 to e95d9e7 Compare March 7, 2026 07:51
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

Preview URLs (2 pages)

(comment last updated: 2026-03-08 23:44:34)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find this sentence strange because the server can generate content-length: 0, as is the example in line 47 below.

RFC 9110 15.3.6. 205 Reset Content

Since the 205 status code implies that no additional content will be provided, a server MUST NOT generate content in a 205 response.

Perhaps @hamishwillee could take a look at how to rephrase this sentence, thank you.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The spec says "should not". I'll patch this here. Thanks.

A user agent SHOULD NOT send a Content-Length header field when the request message does not contain content and the method semantics do not anticipate such data.

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

I think you should replace ! with %21 and set the length to 16 since it's application/x-www-form-urlencoded.

@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Mar 7, 2026
@samuel871211
Copy link
Contributor Author

I think you should replace ! with %21 and set the length to 16 since it's application/x-www-form-urlencoded.

Yes, you are right. Thanks !

@samuel871211 samuel871211 requested a review from Josh-Cena March 7, 2026 23:49
Clarified response content requirements for 205 status code.
Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Thanks very much @samuel871211 (and @Josh-Cena )

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@hamishwillee hamishwillee merged commit b4e920c into mdn:main Mar 8, 2026
7 of 8 checks passed
@samuel871211 samuel871211 deleted the fixExampleContentLength branch March 8, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTTP HTTP docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants