This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14665 - Content-Type is not a simple header
Summary: Content-Type is not a simple header
Status: RESOLVED FIXED
Alias: None
Product: WebAppsSec
Classification: Unclassified
Component: CORS (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-01 21:29 UTC by Anne
Modified: 2011-11-23 17:03 UTC (History)
4 users (show)

See Also:


Attachments

Description Anne 2011-11-01 21:29:52 UTC
Instead of treating Content-Type as a simple header it should be treated as a header that is checked irrespective of origin (whether set by author or UA).

We should also look into unknown MIME type parameters.
Comment 1 Jonas Sicking (Not reading bugmail) 2011-11-02 01:29:48 UTC
I don't understand what this means. The Content-Type header is almost alway set for POST. Does this mean all POSTs should be preflighted?
Comment 2 Anne 2011-11-02 12:54:52 UTC
It is about simple headers being only checked against headers set by authors, whereas Content-Type can also be set by the user agent (e.g. if you pass a File object to send()).
Comment 3 Jonas Sicking (Not reading bugmail) 2011-11-02 16:00:10 UTC
Ah, so you're saying we should always check it's value against the whitelist. Not just when it's set through setRequestHeader or some such?

That I agree with.
Comment 4 Anne 2011-11-23 12:22:38 UTC
Having looked at this some more I think actually that in XMLHttpRequest the send() algorithm should just add Content-Type to author request headers instead. send() is effectively doing a setRequestHeader() thing there.
Comment 5 Anne 2011-11-23 17:03:23 UTC
I changed XMLHttpRequest as suggested:

http://dev.w3.org/cvsweb/2006/webapi/XMLHttpRequest-2/Overview.src.html.diff?r1=1.204;r2=1.205;f=h

I also clarified CORS that Content-Type is supposed to be listed by servers even though it is sometimes a simple header:

http://dvcs.w3.org/hg/cors/rev/83bc552d856f

I think this resolves http://www.w3.org/2011/webappsec/track/actions/11 although the wording of that action is somewhat unclear.