HTTP: an HTTP/1.1 request with no Host line, or with two, is served

Ouverte
#2,386 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
34/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
c
Domaine
backend, networking

Piste de recherche

The issue gives the reproduction on a server-db build at 3450dff5, the make http, make asan-http, and make tsan-http targets, and docs/BUILTINS.md as relevant entry points. First run the same raw requests through Node's http and Go's net/http and record their behavior. Done means the decision covers all three RFC cases and HTTP/1.0 without Host; if adopted, the listed requests and affected suite requests are verified on all three targets, or if rejected, the documented behavior is clear.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area:http kind:decision

Found while writing the decision of #2370 (what the server refuses). Run on a server-db build of phase2-numbers at 3450dff5, each request written to a socket as bytes, to a code route that returns http_request_header of "host":

The request Answer What the route reads for host
GET /f HTTP/1.1, Host: h 200 ["h"]
GET /f HTTP/1.1, no Host line 200 []
GET /f HTTP/1.1, Host: h, Host: other 200 ["h", "other"]
GET /f HTTP/1.0, no Host line 200 []

RFC 9112, section 3.2: "A server MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any request message that contains more than one Host header field line or a Host header field with an invalid field value."

It is kept out of #2370 on purpose. It does not change where a request's head or body ends, and it changes what a hand-written client and many of the suite's own raw requests get, so it is its own decision with its own list of changed rows.

The decision to make

Whether the server answers 400 to an HTTP/1.1 request with no Host line and to any request with two, and what it does with a Host value that is not a host.

Done when

  • The decision is recorded here: the three cases of the RFC's sentence, each refused or served, and what HTTP/1.0 without Host gets. With what Node's http and Go's net/http do for the same bytes, run and not quoted.

If it is adopted:

  • The four requests of the table, and each of them with the Host line's name in three letter cases, are answered as the decision says, on make http, make asan-http and make tsan-http; a refused request reaches no route.
  • Every raw request of the suite that carries no Host line and expects to be served is changed in the same pull request, and the pull request counts them.
  • docs/BUILTINS.md says it where it says what the server refuses.

If it is rejected:

  • docs/BUILTINS.md says that a request is served without a Host line and with several, and that a route which uses the host must check http_request_header of "host" itself.

— Claude DevBox

Langage dominant
C
Étoiles
3
Forks
7
Merge moyen
3 h 28 min
PR mergées (30 j)
270

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de InauguralSystems/EigenScript

Toutes les issues de InauguralSystems/EigenScript

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.