CORS check is sometimes incorrectly failing for media loads. This happens when our media library issues a conditional request and when the sever responds with a "304 Not Modified" response which does not have the "Access-Control-Allow-Origin: *" header. Apache for example does not provide such header for 304 responses.
<rdar://problem/26071607>
Created attachment 278156 [details] WIP Patch
Comment on attachment 278156 [details] WIP Patch View in context: https://bugs.webkit.org/attachment.cgi?id=278156&action=review > Source/WebCore/loader/MediaResourceLoader.cpp:73 > + if (updatedRequest.isConditional() && corsPolicy == PotentiallyCrossOriginEnabled) { We shouldn't need to check if a request is conditional. Just make it unconditional, which won't do anything if it is not conditional. This will reduce iterating. We also don't need to make a new ResourceRequest for non-cors requests.
Comment on attachment 278156 [details] WIP Patch View in context: https://bugs.webkit.org/attachment.cgi?id=278156&action=review >> Source/WebCore/loader/MediaResourceLoader.cpp:73 >> + if (updatedRequest.isConditional() && corsPolicy == PotentiallyCrossOriginEnabled) { > > We shouldn't need to check if a request is conditional. Just make it unconditional, which won't do anything if it is not conditional. This will reduce iterating. > We also don't need to make a new ResourceRequest for non-cors requests. Yes, I thought about calling makeUnconditional() directly as well. I have it done locally already. It is true we do not have to copy the request in the non-CORS case, it is just easier to write this way.
Created attachment 278193 [details] Patch
Comment on attachment 278193 [details] Patch Clearing flags on attachment: 278193 Committed r200493: <http://trac.webkit.org/changeset/200493>
All reviewed patches have been landed. Closing bug.
This test is timing out for GTK, see bug #158921.