[Webkit-unassigned] [Bug 64813] New: HTMLImageElement::crossOrigin is hard to use because of caching

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 19 11:05:21 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=64813

           Summary: HTMLImageElement::crossOrigin is hard to use because
                    of caching
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Page Loading
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: abarth at webkit.org
                CC: kbr at google.com


The crossorigin attribute of HTMLImageElement is hard to use correctly because image responses are often cached.  For example, consider the case where the server always response with the following header:

Access-Control-Allow-Origin: *

If we request the image first without the crossorigin attribute, then we'll send credentials and cache the response in the MemoryCache.  Later, if we request the image with the crossorigin attribute, we'll grab the response out of the MemoryCache, but the CORS check will fail because we'll remember that we sent credentials the first time.

This behavior can be frustrating for web developers who don't understand why the second request isn't allowed.  After all, they said their image was allowed by *.

One possible solution to this problem is to examine the allowCredentials flag when deciding whether the resource in the MemoryCache is appropriate for the given request.  The CachedResourceLoader and CachedResource have a bunch of logic for deciding whether an existing CachedResource is valid for a new request or whether we should evict it and request the resource again.  We could try fixing this issue by including logic to compare the allowCredentials flag in this code path.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list