vendredi 18 avril 2014

Why is this media upload failing 'not allowed by access-control-origin'?


Vote count:

0




Here is the request and response



**Request URL:http://ift.tt/1i13ZSc
Request Method:OPTIONS
Status Code:200 OK
Request Headersview source
:host:www.googleapis.com
:method:OPTIONS
:path:/upload/drive/v2/files/0B6B-RNrxsCu2S0xxSkZQUEQ3eDQ?uploadType=media
:scheme:https
:version:HTTP/1.1
accept:*/*
accept-encoding:gzip,deflate,sdch
accept-language:en-US,en;q=0.8,en-AU;q=0.6
access-control-request-headers:accept, content-type, authorization, upload-content-length, upload-content-type
access-control-request-method:PUT
origin:http://ift.tt/1i13ZSe
referer:http://ift.tt/1i141ta
user-agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36
Query String Parametersview sourceview URL encoded
uploadType:media

**Response Headersview source**
alternate-protocol:443:quic
cache-control:no-cache, no-store, max-age=0, must-revalidate
content-length:0
content-type:application/octet-stream
date:Fri, 18 Apr 2014 06:46:58 GMT
expires:Fri, 01 Jan 1990 00:00:00 GMT
pragma:no-cache
server:HTTP Upload Server Built on Apr 11 2014 13:30:54 (1397248254)
status:200 OK
version:HTTP/1.1


Fails with ...



OPTIONS http://ift.tt/1hRK9h1
Origin http://ift.tt/1i13ZSe is not allowed by Access-Control-Allow-Origin.


By way of confirmation that everything else seems OK...



  • I just created the file that I'm uploading content to, so it's not permissions

  • If I replace PUT with POST, and uploadType=media -> =multipart, then I can correctly create a new file with content.


So it feels like one of



  • I've mis-formed the request in some way

  • Drive bug



asked 1 min ago

pinoyyid

3,685





Aucun commentaire:

Enregistrer un commentaire