Re: [CORS] Charset in content type

2009-03-21 Thread Giovanni Campagna
2009/3/20 Anne van Kesteren ann...@opera.com: On Fri, 20 Mar 2009 18:59:52 +0100, Giovanni Campagna scampa.giova...@gmail.com wrote: You may just enforce validity of known or possibly unsafe headers (Content-Type being the most important) I don't think that is the right place. Ok, just say

Re: [CORS] Charset in content type

2009-03-21 Thread Anne van Kesteren
On Sat, 21 Mar 2009 14:13:33 +0100, Giovanni Campagna scampa.giova...@gmail.com wrote: 2009/3/20 Anne van Kesteren ann...@opera.com: I don't think that is the right place. Ok, just say that implementation *must* pass the appropriate header name and value to the network layer, which in turn

Re: [CORS] Charset in content type

2009-03-21 Thread Giovanni Campagna
2009/3/21 Anne van Kesteren ann...@opera.com: On Sat, 21 Mar 2009 14:13:33 +0100, Giovanni Campagna scampa.giova...@gmail.com wrote: 2009/3/20 Anne van Kesteren ann...@opera.com: I don't think that is the right place. Ok, just say that implementation *must* pass the appropriate header

Re: [CORS] Charset in content type

2009-03-20 Thread Giovanni Campagna
2009/3/19 Anne van Kesteren ann...@opera.com: On Thu, 19 Mar 2009 20:37:50 +0100, Giovanni Campagna scampa.giova...@gmail.com wrote: Actually both of them are invalid per RFC2616 and thus should raise SYNTAX_ERR. I do not want to enforce validity in the XMLHttpRequest API. That seems

Re: [CORS] Charset in content type

2009-03-20 Thread Anne van Kesteren
On Fri, 20 Mar 2009 18:59:52 +0100, Giovanni Campagna scampa.giova...@gmail.com wrote: You may just enforce validity of known or possibly unsafe headers (Content-Type being the most important) I don't think that is the right place. Or actually, they don't per current spec, but I think they

Re: [CORS] Charset in content type

2009-03-19 Thread Jonas Sicking
On Tue, Mar 17, 2009 at 6:40 AM, Anne van Kesteren ann...@opera.com wrote: On Mon, 16 Mar 2009 11:12:01 -, Anne van Kesteren ann...@opera.com wrote: On Mon, 16 Mar 2009 12:07:22 +0100, Alexey Proskuryakov a...@webkit.org wrote: I think that the algorithm can only compare MIME types, not

Re: [CORS] Charset in content type

2009-03-19 Thread Giovanni Campagna
2009/3/19 Jonas Sicking jo...@sicking.cc: [...] Two things that I think we need to watch out for: 1. Someone doing    xhr.setRequestHeader(Content-Type, text/plain; application/xml); 2. Someone doing    xhr.setRequestHeader(Content-Type, text/plain; somewierdthing=application/xml);

Re: [CORS] Charset in content type

2009-03-17 Thread Anne van Kesteren
On Mon, 16 Mar 2009 11:12:01 -, Anne van Kesteren ann...@opera.com wrote: On Mon, 16 Mar 2009 12:07:22 +0100, Alexey Proskuryakov a...@webkit.org wrote: I think that the algorithm can only compare MIME types, not the full Content-Type string. I guess that makes sense. I made this

[CORS] Charset in content type

2009-03-16 Thread Alexey Proskuryakov
Per the current CORS spec draft, a request can only be a simple request if, among other conditions: Custom request headers does not contain a header field name that is an ASCII case-insensitive match for Content-Type or it does contain it and the corresponding header field value is an

Re: [CORS] Charset in content type

2009-03-16 Thread Anne van Kesteren
On Mon, 16 Mar 2009 12:07:22 +0100, Alexey Proskuryakov a...@webkit.org wrote: Per the current CORS spec draft, a request can only be a simple request if, among other conditions: Custom request headers does not contain a header field name that is an ASCII case-insensitive match for

Re: [CORS] Charset in content type

2009-03-16 Thread Thomas Roessler
It strikes me that there are actually two issues here: 1. What constitutes a simple request for the purposes in CORS? As far as that's concerned, I suspect that Alexey has it right. 2. Who should set charset parameter for XMLHttpRequest? The code invoking it or the underlying engine?

Re: [CORS] Charset in content type

2009-03-16 Thread Alexey Proskuryakov
16.03.2009, в 14:12, Anne van Kesteren написал(а): An unrelated question about the same sentence is why the header field value is matched case insensitively. My understanding is that this rule was meant to prevent exposing unsuspecting servers to requests that couldn't be made with

Re: [CORS] Charset in content type

2009-03-16 Thread Anne van Kesteren
On Mon, 16 Mar 2009 12:29:34 +0100, Alexey Proskuryakov a...@webkit.org wrote: The difference is that when one does form enctype=TEXT/Plain, the MIME type on the wire is text/plain, but with setRequestHeader, it's TEXT/Plain. So, server-side code that does case-sensitive comparisons