-
Notifications
You must be signed in to change notification settings - Fork 340
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
strip request-body-header for redireting from POST to GET #977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good to me, modulo nits. Thanks for working on this!
@ricea do you have any further feedback? Should someone else from Chrome be consulted?
@youennf I'm not sure if WebKit does this at the moment, but your review would be appreciated. And we'll file a bug if there are any tests you might fail.
fetch.bs
Outdated
<ol class=brief> | ||
<li><p> Set <var>request</var>'s <a for=request>method</a> to `<code>GET</code>` and | ||
<var>request</var>'s <a for=request>body</a> to null. | ||
<li><p> <p><a for="list">For each</a> <var>headerName</var> of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a markup error here.
fetch.bs
Outdated
<p>then: | ||
|
||
<ol class=brief> | ||
<li><p> Set <var>request</var>'s <a for=request>method</a> to `<code>GET</code>` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the space before "Set".
#944 is a bit related to this, if you wanted to pick up more issues in this space. |
lgtm. It would be nice if there were tests, but I guess whichever browser implements this first will write them. CC: @yutakahirano who was also active on https://bugs.chromium.org/p/chromium/issues/detail?id=765898. |
@davidben are you on board with stripping more headers than |
I like how in 2019, we still don't know what HTTP redirects are. :-) This is a list of request headers to remove, right? This list is strange. Adding @MattMenke2 and @mnot who may have thoughts about this. One hopes the risk of changes here is tiny, but we should incur that risk at most once. |
There's also Transfer-Encoding (No idea if Transfer-Encoding is generally used in place of Content-Encoding for uploads, but if we're encouraging using these sorts of entity-body headers symmetrically for request and response bodies, seems like it should be here). Does seem like we should create some more formal grouping of entity-body headers that can apply both to uploads and downloads, if we want to have some sort of support for consumers setting them in web-platform uploads. |
Can |
The same is true of Content-Encoding, no? I mean, they're nominally different, but in practice, not so much. Regardless, there's discussion of a streaming upload API, which would use chunked uploads. No idea if Chrome's pre-existing chunked upload support uses. |
|
But we still have rules for how forbidden headers are mutated as we follow redirects. Also, I don't think any browser should be letting web content set "Content-Encoding: chunked" directly. |
Though I suppose chunked is generally advertised as a Transfer-Encoding, it just seems not a great idea. |
I don't think The two are effectively orthogonal. |
I do think that consumers have just as much control over Transfer-Encoding: chunked (Assuming we expose a streaming upload API) as they have over Content-Length. Neither one can they set directly, but they can set them indirectly (By their selection of upload body or their choice of upload API). |
We're wondering if we need to remove request-body-header (Content-Type, Content-Language... ) from request headers for GET->GET redirection if the client adds them, e.g, We suspect that leaving GET->GET alone is probably the quickest way to consensus, and I'd like to include GET->GET in the web-platform tests. |
@JuniorHsu if we want to leave GET -> GET alone we do have to add a check for 303 in the specification: that method is not GET or HEAD. As the current wording does affect GET -> GET for 303s. |
Thanks for finding this. It's good to be consistent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great. Also thanks all for the comments. If there are no further issues here I plan to merge this before the end of the week and @JuniorHsu or I will ensure browser bugs as a result of failing tests are filed as well.
Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1530230 |
…headers for redirects, a=testonly Automatic update from web-platform-tests Fetch: delete request-body-headers for certain redirects For whatwg/fetch#977. -- wpt-commits: d09c77af120af9c9db2065378186f7942e2f157f wpt-pr: 20596
…headers for redirects, a=testonly Automatic update from web-platform-tests Fetch: delete request-body-headers for certain redirects For whatwg/fetch#977. -- wpt-commits: d09c77af120af9c9db2065378186f7942e2f157f wpt-pr: 20596 UltraBlame original commit: 9371ed11e8f6975180647ac24191d302972613b5
…headers for redirects, a=testonly Automatic update from web-platform-tests Fetch: delete request-body-headers for certain redirects For whatwg/fetch#977. -- wpt-commits: d09c77af120af9c9db2065378186f7942e2f157f wpt-pr: 20596 UltraBlame original commit: 9371ed11e8f6975180647ac24191d302972613b5
…headers for redirects, a=testonly Automatic update from web-platform-tests Fetch: delete request-body-headers for certain redirects For whatwg/fetch#977. -- wpt-commits: d09c77af120af9c9db2065378186f7942e2f157f wpt-pr: 20596 UltraBlame original commit: 9371ed11e8f6975180647ac24191d302972613b5
…headers for redirects, a=testonly Automatic update from web-platform-tests Fetch: delete request-body-headers for certain redirects For whatwg/fetch#977. -- wpt-commits: d09c77af120af9c9db2065378186f7942e2f157f wpt-pr: 20596
Preview | Diff