xmlhttprequest - Refused to get unsafe header "Content-Range" -
for reason cannot access response header of "content-range" anymore... therefore it's impossible determine file size of resource using xhr. error refused unsafe header "content-range"
on chrome in line:
var cr = this.getresponseheader('content-range');
here's cors config:
<?xml version="1.0" ?> <corsconfig> <cors> <origins> <origin>*</origin> </origins> <methods> <method>get</method> <method>head</method> <method>delete</method> </methods> <responseheaders> <responseheader>x-goog-meta-foo1</responseheader> <responseheader>origin</responseheader> <responseheader>range</responseheader> <responseheader>content-range</responseheader> <responseheader>content-length</responseheader> </responseheaders> <maxagesec>1800</maxagesec> </cors>
curl output:
$ curl -h "origin: http://peer5.com" http://commondatastorage.googleapis.com/peer5_vod/wind2_orig.mp4 -s -d - -o /dev/null http/1.1 200 ok server: http upload server built on may 8 2013 16:51:19 (1368057079) expires: mon, 13 may 2013 09:47:40 gmt date: mon, 13 may 2013 08:47:40 gmt cache-control: public, max-age=3600, no-transform last-modified: fri, 22 mar 2013 17:09:47 gmt etag: "755232ae8fef22bc7b4e9510a68a646e" x-goog-generation: 1363972188238000 x-goog-metageneration: 2 content-type: video/mp4 x-goog-hash: crc32c=pzms2q== x-goog-hash: md5=dviyro/virx7tpuqpopkbg== accept-ranges: bytes content-length: 15535795 access-control-allow-origin: * access-control-expose-headers: content-length, date, server, transfer-encoding
this appears bug on our side. last header value in responseheaders
list returned in access-control-expose-headers
header. working on rolling out fix, workaround, if need content-range
header (content-length
considered simple header cors spec , added automatically), please try setting cors config this:
<?xml version="1.0" ?> <corsconfig> <cors> <origins> <origin>*</origin> </origins> <methods> <method>get</method> <method>head</method> <method>delete</method> </methods> <responseheaders> <responseheader>content-range</responseheader> </responseheaders> <maxagesec>1800</maxagesec> </cors> </corsconfig>
update: bug has been fixed.
Comments
Post a Comment