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

Change new Response() statusText default? #698

Closed
annevk opened this issue Apr 12, 2018 · 2 comments

Comments

2 participants
@annevk
Copy link
Member

commented Apr 12, 2018

In #600 I'm changing the default for network responses (and Response.redirect(), which Safari already aligns with) since HTTP/2 doesn't have a status message. It would make sense to change the default for the API too, but that would be a "breaking" change across all implementations.

It would make sense though.

Concretely, this would mean changing the dictionary default from "OK" to "".

cc @youennf @wanderview @yutakahirano

@domenic

This comment has been minimized.

Copy link
Member

commented Apr 12, 2018

This seems like a good idea since in the current spec you have new Response("", { status: 404 }).statusText === "OK", right?

It seems like if we'd designed this system from scratch we probably would have not exposed statusText at all.

@annevk

This comment has been minimized.

Copy link
Member Author

commented Apr 12, 2018

Yes and yes; I did not know HTTP/2 dropped a primitive.

annevk added a commit that referenced this issue Apr 24, 2018

Make status message default to the empty byte sequence
HTTP/2 does not have a status message (reason phrase) and giving all of HTTP/2's responses `OK` as status message would not be ideal. Therefore this change to the empty byte sequence. As a side effect, that's also a better default for Response.redirect().

Tests: web-platform-tests/wpt#7274 (issue due to lack of HTTP/2 support) and web-platform-tests/wpt#10442 (for Response.redirect()).

Fixes #599 and fixes #664.

Potential follow-up: #698.

annevk added a commit that referenced this issue Nov 20, 2018

Change Response's statusText's default
The empty string is a better default as the field is optional in HTTP and rather meaningless. This way if you change the status and forget about statusText it won't give the mistaken impression things are OK.

Tests: ...

Fixes #698.

@annevk annevk closed this in #836 Nov 21, 2018

annevk added a commit that referenced this issue Nov 21, 2018

Change Response's statusText's default
The empty string is a better default as the field is optional in HTTP and rather meaningless. This way if you change the status and forget about statusText it won't give the mistaken impression things are OK.

Tests: web-platform-tests/wpt#14144.

Fixes #698.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.