Bug 32837

Summary: Explicit Content-Type value "text/css" changed to "text/html, text/css"
Product: WebKit Reporter: JamesVG <jamesvg>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://demo.webplusshop.com/showmedia.wml/storeid/3/istemplate/1/filename/common.css

Description JamesVG 2009-12-21 13:11:51 PST
The referenced URL of a css file sends an explicit Content-Type "text/css" that is interpreted by WebKit as "text/html, text/css" by r52427. This error seems to prevent pages from using the stylesheet.
Comment 1 Mark Rowe (bdash) 2009-12-21 13:40:06 PST
The server is sending two Content-Type headers:

Content-Type: text/html
Content-Type: text/css

RFC 2616 has this to say about the presence of multiple headers with the same name:

> Multiple message-header fields with the same field-name MAY be present
> in a message if and only if the entire field-value for that header field
> is defined as a comma-separated list [i.e., #(values)].

Since Content-Type’s value isn’t defined to be a comma-separated list the response headers for this resource appear to be invalid.  That said, we appear to be handling these invalid headers in a different manner than how Firefox handles them.  We should look at matching their behavior here.

In the mean time the website could achieve the result they’re after by sending valid response headers.
Comment 2 Mark Rowe (bdash) 2009-12-21 13:59:17 PST
This aspect of HTTP is handled by the underlying HTTP stack used by WebKit, in this case CFNetwork.  CFNetwork itself is not part of WebKit so this bug needs to be tracked in Radar.  It’s been written up as <rdar://problem/7209476>.  Thanks for the report.