Bug 31868 - Web Inspector: Load InspectorResource mime type from CachedResource for 304 response
Summary: Web Inspector: Load InspectorResource mime type from CachedResource for 304 r...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-11-25 06:26 PST by Alexander Pavlov (apavlov)
Modified: 2009-11-25 08:15 PST (History)
7 users (show)

See Also:

patch (2.29 KB, patch)
2009-11-25 07:29 PST, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
patch (fixed) (2.31 KB, patch)
2009-11-25 07:42 PST, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 Pavel Feldman 2009-11-25 07:34:19 PST
Comment on attachment 43843 [details]

> +    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.