Does Safari supports Access-Control-Expose-Headers header?

865 Views Asked by At

I need to read the Location header using XHR. I have added an Access-Control-Expose-Headers header to the OPTIONS response and to the response where I need to read the header:

Access-Control-Expose-Headers: Location

This works in Chrome, Firefox and IE10, but not in Safari 5.1.7.

Does Safari support the Access-Control-Expose-Headers header?

1

There are 1 best solutions below

0
On

After glancing at versions of the CORS spec, my guess is that Safari 5.1 (and similar versions) were using a build of webkit that did not include support for the Access-Control-Expose-Headers header. This wasn't added to the CORS spec draft until July of 2010. Safari 5.1 was released in July of 2011. According to this message thread, Access-Control-Expose-Headers support wasn't added to webkit until sometime after November 2011, which means Safari 5.1 definitely did not support this. According to this webkit/safari bug support wasn't added until mid-January 2012, meaning that the earliest version to contain this support would be 5.1.7 (but possibly even later).