Bug 159350

Summary: Synchronous preflight should check for successful responses
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, buildbot, cdumez, commit-queue, darin, japhet, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews100 for mac-yosemite
none
Archive of layout-test-results from ews105 for mac-yosemite-wk2
none
Archive of layout-test-results from ews114 for mac-yosemite
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Rebasing new test expectation
none
Patch for landing
none
Archive of layout-test-results from webkit-cq-03 for mac-yosemite
none
Patch for landing none

Description youenn fablet 2016-07-01 06:57:18 PDT
Synchronous preflight should check for successful responses
Comment 1 youenn fablet 2016-07-01 07:03:13 PDT
Created attachment 282546 [details]
Patch
Comment 2 Build Bot 2016-07-01 07:49:48 PDT
Comment on attachment 282546 [details]
Patch

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

New failing tests:
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 3 Build Bot 2016-07-01 07:49:52 PDT
Created attachment 282549 [details]
Archive of layout-test-results from ews100 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-07-01 07:53:39 PDT
Comment on attachment 282546 [details]
Patch

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

New failing tests:
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 5 Build Bot 2016-07-01 07:53:42 PDT
Created attachment 282550 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-07-01 07:59:54 PDT
Comment on attachment 282546 [details]
Patch

Attachment 282546 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1606710

New failing tests:
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 7 Build Bot 2016-07-01 07:59:57 PDT
Created attachment 282551 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-07-01 08:00:40 PDT
Comment on attachment 282546 [details]
Patch

Attachment 282546 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1606711

New failing tests:
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 9 Build Bot 2016-07-01 08:00:42 PDT
Created attachment 282552 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 10 youenn fablet 2016-07-01 09:38:45 PDT
Created attachment 282557 [details]
Rebasing new test expectation
Comment 11 youenn fablet 2016-07-29 06:28:09 PDT
Ping review?
Comment 12 Darin Adler 2016-07-29 12:06:00 PDT
Comment on attachment 282557 [details]
Rebasing new test expectation

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

> Source/WebCore/loader/CrossOriginPreflightChecker.cpp:142
> +    bool isRedirect = request.url() != response.url();

Is this a correct check? Is there no other way the two URLs could be non-equal? For example, could the response one be missing the username and password part? Or missing the part after the #?
Comment 13 youenn fablet 2016-07-30 11:02:44 PDT
Created attachment 284947 [details]
Patch for landing
Comment 14 youenn fablet 2016-07-30 11:04:16 PDT
(In reply to comment #12)
> Comment on attachment 282557 [details]
> Rebasing new test expectation
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282557&action=review
> 
> > Source/WebCore/loader/CrossOriginPreflightChecker.cpp:142
> > +    bool isRedirect = request.url() != response.url();
> 
> Is this a correct check? Is there no other way the two URLs could be
> non-equal? For example, could the response one be missing the username and
> password part? Or missing the part after the #?

Right, this check is the same as the one from DocumentThreadableLoader and suffer from the same issue. Since the scope is bit different than for DocumentThreadableLoader, I changed it to something less restrictive using URL::strippedForUseAsReferrer before comparison.
Comment 15 WebKit Commit Bot 2016-07-30 11:50:22 PDT
Comment on attachment 284947 [details]
Patch for landing

Rejecting attachment 284947 [details] from commit-queue.

New failing tests:
http/tests/xmlhttprequest/access-control-preflight-headers-sync.html
Full output: http://webkit-queues.webkit.org/results/1780716
Comment 16 WebKit Commit Bot 2016-07-30 11:50:28 PDT
Created attachment 284948 [details]
Archive of layout-test-results from webkit-cq-03 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: webkit-cq-03  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 17 youenn fablet 2016-07-30 11:58:33 PDT
Created attachment 284949 [details]
Patch for landing
Comment 18 WebKit Commit Bot 2016-07-30 12:28:25 PDT
Comment on attachment 284949 [details]
Patch for landing

Clearing flags on attachment: 284949

Committed r203943: <http://trac.webkit.org/changeset/203943>
Comment 19 WebKit Commit Bot 2016-07-30 12:28:32 PDT
All reviewed patches have been landed.  Closing bug.