Bug 185023 - Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
Summary: Make cross origin redirection error messages consistent between SubresourceLo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-25 21:40 PDT by youenn fablet
Modified: 2018-04-26 11:18 PDT (History)
8 users (show)

See Also:


Attachments
Patch (14.43 KB, patch)
2018-04-25 21:46 PDT, youenn fablet
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-sierra-wk2 (2.95 MB, application/zip)
2018-04-25 22:57 PDT, EWS Watchlist
no flags Details
Patch (17.76 KB, patch)
2018-04-26 08:40 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-04-25 21:40:56 PDT
Mak cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
Comment 1 youenn fablet 2018-04-25 21:46:22 PDT
Created attachment 338854 [details]
Patch
Comment 2 EWS Watchlist 2018-04-25 22:57:02 PDT
Comment on attachment 338854 [details]
Patch

Attachment 338854 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/7464630

New failing tests:
http/tests/xmlhttprequest/redirect-cross-origin-post-sync.html
http/tests/xmlhttprequest/redirect-cross-origin-sync.html
http/tests/xmlhttprequest/access-control-and-redirects.html
http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html
Comment 3 EWS Watchlist 2018-04-25 22:57:03 PDT
Created attachment 338859 [details]
Archive of layout-test-results from ews105 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 4 youenn fablet 2018-04-26 08:40:20 PDT
Created attachment 338872 [details]
Patch
Comment 5 Chris Dumez 2018-04-26 10:11:06 PDT
Comment on attachment 338872 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=338872&action=review

> LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:-1
> -CONSOLE MESSAGE: Cross-origin redirection to http://localhost:8000/security/contentSecurityPolicy/resources/alert-pass.js denied by Cross-Origin Resource Sharing policy: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.

Seems like we're losing useful information here? We no longer know that the issue is related to a redirect?
Comment 6 youenn fablet 2018-04-26 10:21:58 PDT
Comment on attachment 338872 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=338872&action=review

>> LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:-1
>> -CONSOLE MESSAGE: Cross-origin redirection to http://localhost:8000/security/contentSecurityPolicy/resources/alert-pass.js denied by Cross-Origin Resource Sharing policy: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
> 
> Seems like we're losing useful information here? We no longer know that the issue is related to a redirect?

This is consistent with WebKit1.
"Cross-origin redirection to XXX" is happening when we we get a redirect response that fails COR checks. The message tells that we decide to not follow the redirection.
"Origin XX is not allowed" is happening in the case where we do get a non-redirection response and CORS checks fail.

We could try to come up with a third kind of message for the case of "we followed redirections and the final non-redirect response failed CORS checks".
But we would need to change both SubresourceLoader and NetworkLoadChecker.
Comment 7 WebKit Commit Bot 2018-04-26 11:17:01 PDT
Comment on attachment 338872 [details]
Patch

Clearing flags on attachment: 338872

Committed r231055: <https://trac.webkit.org/changeset/231055>
Comment 8 WebKit Commit Bot 2018-04-26 11:17:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-04-26 11:18:31 PDT
<rdar://problem/39764047>