websemantics / vimeo-upload

Upload videos to your Vimeo account and update their metadata directly from a browser or a Node.js app
http://websemantics.github.io/vimeo-upload/
Apache License 2.0
114 stars 80 forks source link

onContentUploadError_ handler for Request header field X-Upload-Content-Type is not allowed by Access-Control-Allow-Headers in preflight response. #20

Open bcaballero opened 7 years ago

bcaballero commented 7 years ago

I'm having an intermittent error on the uploader when trying upload videos. There are times that I got this error on console.

PUT https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1 net::ERR_CONNECTION_RESET first.js:22460 XHR failed loading: PUT "https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1".

me.sendFile_ @ first.js:22460 (anonymous) @ first.js:22416

This results to numerous request on vimeo, ending up with 429 error on Vimeo related to rate limits.

XMLHttpRequest cannot load https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1. Request header field X-Upload-Content-Type is not allowed by Access-Control-Allow-Headers in preflight response. first.js:22478 XHR failed loading: PUT "https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1". me.resume @ first.js:22478 me.onContentUploadError @ first.js:22610

After series of debugs, I found that the error was triggered within the onContentUploadError handler. It falls within the retryHandler which causes an infinite loop.

`/**

Any suggestions on how to fix this issue? Thank you in advance.