-
Notifications
You must be signed in to change notification settings - Fork 385
Closed
Labels
Description
The statusText property of Response is unclear for HTTP/2.
HTTP/2 does not include a status message / reason like HTTP/1.1: RFC 7540
8.1.2.4. Response Pseudo-Header Fields
...
HTTP/2 does not define a way to carry the version or reason phrase
that is included in an HTTP/1.1 status line.
The Fetch spec simply defines statusText as the status message value, which unless otherwise specified is OK.
For HTTP/2 it seems status message could be interpreted any number of ways:
- empty string - because there is no reason phrase
"OK"- because that is always the default (would be weird to have a 404 OK though)- implementation defined - such as some default reason text for a status code
Different browser behaviors. Test on an HTTP/2 capable domain.
fetch("/").then((r) => console.log(r.statusText)); // 200- Chrome:
"" - Firefox:
"OK" - Safari:
"HTTP/2.0 200"
fetch("/doesnotexistasdf").then((r) => console.log(r.statusText)); // 404- Chrome:
"" - Firefox:
"Not Found" - Safari:
"HTTP/2.0 404"
Reactions are currently unavailable