ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Oct 2016 08:04:20 +0000 (08:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Oct 2016 08:04:20 +0000 (08:04 +0000)
commit83f70ba9fe314c5fed474fd49ba69bf6b80bf168
tree5255a8bfd5bfe309a23db5cf08a03901553ef851
parent9057d92c2c552fe1288a16522d8f4c45c5507ea4
ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
https://bugs.webkit.org/show_bug.cgi?id=163242

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-24
Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/security/cross-origin-cached-images-canvas.html

We were previously on Origin HTTP header to check whether requests were made from different origins.
This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.

Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::isRequestMatchingResourceOrigin):
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):

LayoutTests:

* http/tests/security/cross-origin-cached-images-canvas-expected.txt: Added.
* http/tests/security/cross-origin-cached-images-canvas.html: Added.
* http/tests/security/resources/cross-origin-cached-image-canvas-iframe.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/cross-origin-cached-images-canvas-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/cross-origin-cached-images-canvas.html [new file with mode: 0644]
LayoutTests/http/tests/security/resources/cross-origin-cached-image-canvas-iframe.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedResourceLoader.cpp