Bug 19072 - Resource types should only be identfied by the Content-Type value
Summary: Resource types should only be identfied by the Content-Type value
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-15 02:26 PDT by Markus Wulftange
Modified: 2008-07-30 06:28 PDT (History)
1 user (show)

See Also:


Attachments
Using as self-reference as external stylesheet (718 bytes, text/html)
2008-07-30 05:19 PDT, Markus Wulftange
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Wulftange 2008-05-15 02:26:48 PDT
The type of data of responses should only be identified by the Content-Type value that was sent. It should not be tried to "guess" the content type.

Examples:
* If a HTML document contains a link to an external CSS stylesheet only responses with the Content-Type value "text/css" should be accepted.
* If a HTML document embedds an image via the IMG element only responses with valid values for image types (e.g. "image/...") should be accepted.
Comment 1 Robert Blaut 2008-07-28 13:53:37 PDT
Markus, could you provide test cases or real examples of buggy, according you, behavior of WebKit?

You should notice, that HTML5 specification defines content sniffing as other *proper* method of determining resource content type: http://www.whatwg.org/specs/web-apps/current-work/#content-type-sniffing
Comment 2 Markus Wulftange 2008-07-30 05:19:10 PDT
Created attachment 22551 [details]
Using as self-reference as external stylesheet

At least the latest Safari version (5525.20.1) accepts a document sent as text/html to be used as an external stylesheet.
Comment 3 Robert Blaut 2008-07-30 06:10:36 PDT
(In reply to comment #2)
> Created an attachment (id=22551) [edit]
> Using as self-reference as external stylesheet
> 
> At least the latest Safari version (5525.20.1) accepts a document sent as
> text/html to be used as an external stylesheet.
> 

(In reply to comment #2)
> Created an attachment (id=22551) [edit]
> Using as self-reference as external stylesheet
> 
> At least the latest Safari version (5525.20.1) accepts a document sent as
> text/html to be used as an external stylesheet.
> 

This bug was fixed long time ago. Check bug  17298 for details.

What about the other case: "If a HTML document embedds an image via the IMG element only responses with valid values for image types (e.g. "image/...") should be accepted."? Do you have test case for it?
Comment 4 Markus Wulftange 2008-07-30 06:23:49 PDT
No, I have no test case.
Comment 5 Robert Blaut 2008-07-30 06:28:39 PDT
(In reply to comment #4)
> No, I have no test case.
> 

So I assume that I can close the bug report. 

Markus, feel free to reopen this report if you have real example of reported image issue.