rust-lang / rust-lang/book

chapter 21 Building a Single-Threaded Web Server - incorrect http request definition

Open
#4,574 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
18.3k
Forks
4.1k
Avg merge
14m
Merged PRs (30d)
1

Description

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch21-01-single-threaded.html

Description of the problem:

The browser signals the end of an HTTP request by sending two newline characters in a row, so to get one request from the stream, we take lines until we get a line that is the empty string.

Is not correct.

\r\n\r\n

Indicates the end of the headers of the request not the full request.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Messages

Suggested fix:

Use the following wording:

The browser signals the end of the optional HTTP request header by sending a carriage return and newline character twice in a row, so to get the headers of one request from the stream, we take lines until we get a line that is the empty string.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open src/ch21-01-single-threaded.md and locate the passage describing how the browser signals the end of an HTTP request. Compare it with the cited MDN guidance and update the wording so it describes the end of the optional request headers; done means the text no longer claims that this marks the end of the full request.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.