Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Aug 3, 2017 · 0 comments

Comments

@bcaballero
Copy link

bcaballero commented Aug 3, 2017

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.

/** * Handles errors for uploads. Either retries or aborts depending * on the error. * * @private * @param {object} e XHR event */ me.prototype.onContentUploadError_ = function(e) { if (e.target.status && e.target.status < 500) { this.onError(e.target.response) } else { this.retryHandler.retry(this.resume_()) } }

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant