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

Reqwest adds access-control headers which forces preflight #245

Open
LukasBombach opened this issue Jun 2, 2016 · 1 comment
Open

Reqwest adds access-control headers which forces preflight #245

LukasBombach opened this issue Jun 2, 2016 · 1 comment

Comments

@LukasBombach
Copy link

Hi

I am trying to use reqwest with YouTube's oEmbed API. As compared to a plain XMLHttpRequest, reqwest adds 2 headers:

access-control-request-headers:accept, content-type, x-requested-with
access-control-request-method:GET

which triggers a preflight request. Unfortunately YouTube blocks that request because the method used for the preflight request is OPTIONS and returns a 405. Because this request fails, no actual (GET) request is being invoked and I cannot query YouTube's API.

I am not quite sure where these headers come from and if they can be disabled.

@Lukewh
Copy link

Lukewh commented Nov 3, 2016

@LukasBombach Have you set crossOrigin: true in the options?

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

2 participants