Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Issue 1196423003: Improve console log message for CORS failure (Closed)

Created:
5 years, 6 months ago by tyoshino (SeeGerritForStatus)
Modified:
4 years, 4 months ago
Reviewers:
sof
CC:
blink-reviews, tyoshino+watch_chromium.org, Nate Chapin, gavinp+loader_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve console log message for CORS failure When a simple cross-origin request has been made and then blocked, a log message of "blocked from loading" may sound confusing since we've loaded the resource from the server but just prevented the response from being delivered to the page. When a redirect has been blocked, the error message should say that the redirect has been blocked and the reason (e.g. whether the redirect location is bad or the response didn't pass the CORS check) clearly. BUG=417786 R=sof Committed: https://crrev.com/e322d4d55b82f8bf1c4dd8e755e404bc46d9e39a Cr-Commit-Position: refs/heads/master@{#408918}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : LayoutTests rebase #

Patch Set 4 : #

Patch Set 5 : Rebase #

Total comments: 7

Patch Set 6 : a #

Total comments: 10

Patch Set 7 : Rebase, Addressed #9 #

Total comments: 4

Patch Set 8 : Addressed #12 #

Patch Set 9 : Update layout test expectations #

Patch Set 10 : Update expectations #

Patch Set 11 : Removed unrelated expectation changes #

Patch Set 12 : Again #

Patch Set 13 : Reverted from change #

Patch Set 14 : Rebase #

Patch Set 15 : Fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -140 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/htmlimports/cors-same-origin-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/htmlimports/cross-origin-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/img-crossorigin-redirect-anonymous-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/img-crossorigin-redirect-credentials-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/img-crossorigin-redirect-no-cors-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/img-with-failed-cors-check-fails-to-load-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/link-crossorigin-stylesheet-reinserted-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/link-crossorigin-stylesheet-use-credentials-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/local-image-from-remote-whitelisted-expected.txt View 1 2 3 4 5 6 7 8 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/preload-script-crossorigin-fails-cross-origin-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-crossorigin-fails-cross-origin-2-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-crossorigin-fails-cross-origin-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-crossorigin-loads-correctly-credentials-2-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-crossorigin-redirect-anonymous-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-crossorigin-redirect-credentials-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-crossorigin-redirect-no-cors-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/script-with-failed-cors-check-fails-to-load-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-no-cors-bad-integrity-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/text-track-crossorigin-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/video-poster-cross-origin-crash-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/video-poster-cross-origin-crash2-expected.txt View 1 2 3 4 5 6 7 8 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt View 1 2 3 4 5 6 7 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-in-body-onload-sync-to-invalid-redirect-response-handling-expected.txt View 1 2 3 4 5 6 7 1 chunk +10 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/http/tests/security/contentSecurityPolicy/image-blocked-alt-content-expected.png View 1 2 3 4 5 6 7 8 12 Binary file 0 comments Download
M third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp View 1 2 3 4 5 6 7 2 chunks +17 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +61 lines, -56 lines 0 comments Download

Messages

Total messages: 40 (21 generated)
tyoshino (SeeGerritForStatus)
5 years, 6 months ago (2015-06-24 13:17:52 UTC) #2
sof
you're perhaps trying to do too many small things at the same time here. https://chromiumcodereview.appspot.com/1196423003/diff/80001/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt ...
5 years, 6 months ago (2015-06-25 11:24:18 UTC) #3
tyoshino (SeeGerritForStatus)
On 2015/06/25 11:24:18, sof wrote: > you're perhaps trying to do too many small things ...
5 years, 5 months ago (2015-06-30 04:55:34 UTC) #4
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1196423003/diff/80001/Source/core/fetch/CrossOriginAccessControl.cpp File Source/core/fetch/CrossOriginAccessControl.cpp (right): https://codereview.chromium.org/1196423003/diff/80001/Source/core/fetch/CrossOriginAccessControl.cpp#newcode185 Source/core/fetch/CrossOriginAccessControl.cpp:185: errorDescription = "Response for preflight has invalid HTTP status ...
5 years, 5 months ago (2015-06-30 05:30:08 UTC) #5
tyoshino (SeeGerritForStatus)
Reviving 13 month old CL... https://codereview.chromium.org/1196423003/diff/80001/Source/core/fetch/CrossOriginAccessControl.cpp File Source/core/fetch/CrossOriginAccessControl.cpp (right): https://codereview.chromium.org/1196423003/diff/80001/Source/core/fetch/CrossOriginAccessControl.cpp#newcode233 Source/core/fetch/CrossOriginAccessControl.cpp:233: if (!isLegalRedirectLocation(newURL, errorDescription)) On ...
4 years, 5 months ago (2016-07-22 12:46:45 UTC) #8
sof
https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp (right): https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp#newcode304 third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp:304: errorMessage = "Redirect from '" + originalURL.getString() + "' ...
4 years, 5 months ago (2016-07-24 07:48:00 UTC) #9
tyoshino (SeeGerritForStatus)
Thanks https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp (right): https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp#newcode304 third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp:304: errorMessage = "Redirect from '" + originalURL.getString() + ...
4 years, 4 months ago (2016-07-26 09:13:00 UTC) #10
sof
lgtm https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp (right): https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp#newcode311 third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp:311: if (!originalOrigin->canRequest(newURL)) { On 2016/07/26 09:13:00, tyoshino wrote: ...
4 years, 4 months ago (2016-07-27 11:51:03 UTC) #11
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp (right): https://codereview.chromium.org/1196423003/diff/120001/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp#newcode311 third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp:311: if (!originalOrigin->canRequest(newURL)) { On 2016/07/27 11:51:03, sof wrote: > ...
4 years, 4 months ago (2016-07-28 12:23:06 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/1196423003/160001
4 years, 4 months ago (2016-07-28 12:43:08 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/270674)
4 years, 4 months ago (2016-07-28 13:49:12 UTC) #18
tyoshino (SeeGerritForStatus)
Updated more test expectations I didn't cover.
4 years, 4 months ago (2016-08-01 04:10:50 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/1196423003/260001
4 years, 4 months ago (2016-08-01 04:11:12 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/199521) chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 4 months ago (2016-08-01 04:14:07 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/1196423003/280001
4 years, 4 months ago (2016-08-01 04:36:55 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/199524) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 4 months ago (2016-08-01 04:44:24 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/1196423003/300001
4 years, 4 months ago (2016-08-01 04:54:15 UTC) #36
commit-bot: I haz the power
Committed patchset #15 (id:300001)
4 years, 4 months ago (2016-08-01 06:19:17 UTC) #38
commit-bot: I haz the power
4 years, 4 months ago (2016-08-01 06:20:45 UTC) #40
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/e322d4d55b82f8bf1c4dd8e755e404bc46d9e39a
Cr-Commit-Position: refs/heads/master@{#408918}

Powered by Google App Engine
This is Rietveld 408576698