Bug 31868

Summary: Web Inspector: Load InspectorResource mime type from CachedResource for 304 response
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, commit-queue, joepeck, pfeldman, pmuellr, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
pfeldman: review-
patch (fixed) none

Description Alexander Pavlov (apavlov) 2009-11-25 06:26:31 PST
Currently, the mime type of cached resources is provided to the InspectorController in ResourceResponses (coming directly from the CFNetwork library). Since WebCore issues an "If-Modified-Since" request header, it is supposed to know the actual resource data it tries to revalidate. Other network libraries may fail to provide the revalidated resource mime type in the ResourceResponse, as the "Content-Type" header is absent in the 304 HTTP response, which results in a failure to determine the cached resource mime type in the Web Inspector.
Comment 1 Alexander Pavlov (apavlov) 2009-11-25 07:29:32 PST
Created attachment 43843 [details]
patch
Comment 2 Pavel Feldman 2009-11-25 07:34:19 PST
Comment on attachment 43843 [details]
patch

> +    if (response.httpStatusCode() == 304) {
> +        CachedResource* cachedResource = cache()->resourceForURL(response.url().string());
> +        if (cachedResource)
> +            m_mimeType = cachedResource->response().mimeType();
> +    }

Could you do this only in case network stack did not provide this information && 304?
Comment 3 Alexander Pavlov (apavlov) 2009-11-25 07:42:01 PST
Created attachment 43845 [details]
patch (fixed)
Comment 4 WebKit Commit Bot 2009-11-25 08:15:47 PST
Comment on attachment 43845 [details]
patch (fixed)

Clearing flags on attachment: 43845

Committed r51385: <http://trac.webkit.org/changeset/51385>
Comment 5 WebKit Commit Bot 2009-11-25 08:15:59 PST
All reviewed patches have been landed.  Closing bug.