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

Re: CORS and HTTP error responses

From: Jeff Walden <jwalden@MIT.EDU>
Date: Tue, 17 Nov 2009 22:38:03 -0800
Message-ID: <4B03964B.20807@mit.edu>
To: robert@ocallahan.org
CC: Anne van Kesteren <annevk@opera.com>, public-webapps@w3.org
On 11/17/2009 02:42 AM, Robert O'Callahan wrote:
> It might be worth explicitly mentioning that CORS headers can (and
> sometimes should) be included in error responses, perhaps with an
> example of when that would make sense. Maybe I'm over-paranoid but it
> just struck me (and Jeff Walden) as something that server implementers
> are likely to overlook.

A couple data points:

Apache's header-addition directive currently isn't applied to 416 responses; a cursory search suggests that quirk (it's hard to call it a bug except with respect to CORS's particular requirements) might not be in Apache's bug database.  Mozilla had to alter its HTTP test server specifically to apply its flavor of header directives to 416 responses.  The thought never even crossed my mind that 416 responses might want those customized headers when I reviewed the server's byte-range patch.

When fail-fast, fail-silently-and-securely is the default mode of thinking (as it should be when implementing any sort of server), it's an easy thing to forget that custom headers should sometimes be applied to error responses.  Explicitly noting that some error responses may require CORS headers would have made me more sensitive to that possibility when I was giving advice as to how to write tests using CORS, and it would have made it more likely I'd have seen the potential problem rather than learned it through someone else's debugging efforts.

Received on Wednesday, 18 November 2009 06:39:12 UTC

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