W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2008

setRequestHeader underspecified - setting "Accept" header as an example

From: Hallvord R. M. Steen <hallvord@opera.com>
Date: Tue, 18 Nov 2008 13:50:36 +0100
To: public-webapps@w3.org
Message-ID: <op.uktfamd6a3v5gv@hr-opera.oslo.opera.com>

I've found a site that requires that any UA default value is overridden  
with the new value when using setRequestHeader('Accept', ..).

(For reference: the site is mail.163.com, it uses XHR extensively to fetch  
data and sets Accept header to "text/javascript" to fetch JSON content. If  
that value is appended to the UA's internal list instead of replacing it  
the server returns XML instead of JSON, which doesn't go down well with  
the JSON "parsing" - i.e. eval() - they put the data through.)

The spec says about "setRequestHeader()":

> If the header argument is in the list of request headers either use  
> multiple headers, combine the values or use a combination of those  
> (section 4.2, RFC 2616).

I think this needs to be way more specific. We probably need to verify  
what existing UAs do for actual header values, and make some sensible  
rules from that.

Hallvord R. M. Steen
Core JavaScript tester, Opera Software
Opera - simply the best Internet experience
Received on Tuesday, 18 November 2008 12:51:20 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:12 UTC