Bug 48525

Summary: Web Inspector: Incorrectly reports warning on missing/incorrect content-type for 304s
Product: WebKit Reporter: Derk-Jan Hartman <hartman.wiki>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, apavlov, barney_stratford, bweinstein, eric, joepeck, keishi, loislo, pfeldman, pmuellr, rik, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Suggested fix yurys: review+

Description Derk-Jan Hartman 2010-10-28 08:09:40 PDT
I have a webrequest of the form: http://localhost/wiki/load.php?debug=true&lang=en&modules=mediawiki.legacy.commonPrint&only=styles&skin=vector

This has the Content-Type for CSS.

When I reload my page, the same request responds with a 304 Not Modified. In this case the content-type is stripped from the response header, because per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html such responses do not have a content-type.

The inspector reports in this case: "Resource interpreted as script but transferred with MIME type text/php.", whereas it should assume the content-type of the earlier request, it apparently is assuming the content-type of the file extension.
Comment 1 Barney Stratford 2011-04-03 11:23:19 PDT
I can confirm the presence of this issue but do not have permission to update the bug's status. In my case I was using a Python-generated CSS.
Comment 2 Alexander Pavlov (apavlov) 2011-04-04 00:55:52 PDT
Created attachment 88040 [details]
[PATCH] Suggested fix
Comment 3 Alexander Pavlov (apavlov) 2011-04-04 04:35:00 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
        M       Source/WebCore/ChangeLog
        M       Source/WebCore/inspector/front-end/Resource.js
Committed r82822
Comment 4 WebKit Review Bot 2011-04-04 06:17:16 PDT
http://trac.webkit.org/changeset/82822 might have broken Leopard Intel Debug (Tests)
The following tests are not passing:
fast/preloader/scan-body-from-head-script.html