W3C home > Mailing lists > Public > public-webapi@w3.org > June 2008

[XHR] Content-Type fixups

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 10 Jun 2008 09:42:30 +1000
To: public-webapi@w3.org
Message-ID: <20080609234230.GA12980@arc.mcc.id.au>

If the Content-Type header has to be fixed up to match the encoding
being used to send a String, what should happen if the user-specified
header is malformed?

  var r = new XMLHttpRequest();
  r.open("POST", "somewhere");
  r.setRequestHeader("Content-Type",
                     "text/plain; a=b; charset==US-ASCII; c=d");
  r.send("something");

Would it be fair for the a=b and c=d parameters to be ditched and the
header replaced with:

  Content-Type: text/plain; charset=UTF-8

?  How about if the type/subtype part is malformed?

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Monday, 9 June 2008 23:43:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 June 2008 23:43:15 GMT