Repository navigation
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=180347 - #9039
Conversation
Build PASSEDStarted: 2018-01-15 17:18:01 View more information about this build on: |
annevk
left a comment
There was a problem hiding this comment.
@jakearchibald could you maybe look at the service worker bits? This looks good to me.
|
Would be nice if we could move forward with this PR. |
wanderview
left a comment
There was a problem hiding this comment.
Overall looks good, but I'd like to keep some of the coverage that is being removed here. Also, the fetch test doesn't seem to be testing no-cors follow.
| redirectMode("Redirect " + statusCode + " in \"manual\" redirect, cors mode", redirUrl, locationUrl, statusCode, "manual", "cors"); | ||
| } | ||
| redirectMode("Redirect in \"error\" redirect, no cors mode", redirUrl, locationUrl, 301, "error", "no-cors"); | ||
| redirectMode("Redirect in \"manual\" redirect, no cors mode", redirUrl, locationUrl, 301, "manual", "no-cors"); |
There was a problem hiding this comment.
Shouldn't there be a "no-cors" case with redirect mode "follow" here? Don't we want to exercise that to verify it rejects? Also, why not just wrap the status code for-loop above in a loop that changes the mode? That seems the best way to make sure every combination is exercised.
| }, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' + | ||
| 'cors with credentials should succeed interception ' + | ||
| 'and response should not be redirected'); | ||
|
|
There was a problem hiding this comment.
Why delete these test cases? They are there to cover all possible inputs. It seems we should just set the result to the correct expectation; which is to now reject.
| }); | ||
| }, 'Non-navigation, error redirect, no-cors mode Request redirected to ' + | ||
| 'cors with credentials should fail interception and response should not ' + | ||
| 'be redirected'); |
There was a problem hiding this comment.
Same with these cases. I'd prefer to keep coverage of all the possible inputs even if they are all hitting the same internal condition. In the future the internal conditions may change, but the possible set of inputs is fixed.
There was a problem hiding this comment.
Yes I'm curious the reason to delete these too.
| urlParameters += "&location=" + encodeURIComponent(redirectLocation); | ||
|
|
||
| var requestInit = {"redirect": redirectMode}; | ||
| var requestInit = {"redirect": redirectMode, mode: corsMode}; |
There was a problem hiding this comment.
nit: remove the quotes from "redirect" or add them to "mode" also for consistency
| }); | ||
| }, 'Non-navigation, error redirect, no-cors mode Request redirected to ' + | ||
| 'cors with credentials should fail interception and response should not ' + | ||
| 'be redirected'); |
There was a problem hiding this comment.
Yes I'm curious the reason to delete these too.
|
Thanks for the feedback, I'll fix the PR accordingly. |
3e55af3 to
27bc2d6
Compare
|
@youennf Is it intentional that this test switched from http:// to https:// for the redirect URL? That makes all these fetches cross-origin and possibly mixed content? |
|
I'm going to do some fixes on the gecko side and sync back. |
|
Actually, I'll do an upstream PR since the sync'ing is a bit lagged. |
Probably not intentional indeed. |
…directs #9039 wasn't quite aligned with the specification.
fetch()'s redirect feature is insecure combined with "no-cors" or "cors"