-
Notifications
You must be signed in to change notification settings - Fork 37
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
Request header field authorization is not allowed by Access-Control-Allow-Headers AND Accept-Encoding error #95
Comments
You have to use a proxy since you are using it from the browser. Take a look in browser examples and here https://hendt.github.io/ebay-api/ |
Thanks for the feedback It's solved. I put this config (only for testing):
But now I have Accept-Encoding error: This is my header:
How I can solve this problem? |
Why do set the headers? It's not required. Just take a look in the source code of the page I posted. |
That's my full configuration. But same issiue with "Accept-Encoding"
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@hendt/ebay-api@latest/lib/ebay-api.min.js"></script>
</head>
<body>
<script>
const eBay = new eBayApi({
appId: '-',
certId: '-'',
sandbox: false,
});
eBay.req.instance.interceptors.request.use((request) => {
request.url = 'https://ebay.hendt.workers.dev/' + request.url;
return request;
});
eBay.commerce.taxonomy.getCategoryTree('77').then(data=>console.log(data))
</script>
</body>
</html> Tested with Chrome and FF. Both works for me. |
I'm able to reproduce the error now. I'm on it. |
@muhammed671 |
Thanks for fixing. In my local test envairment it looks good. Next step, needs to check it in production on the server with my own proxy. I will let you know about the result. |
It works also on production with own proxy. Used Proxy Server: @dantio Thanks for support and fixing the issue |
Nice! Thank you, I'll add cors-anywhere to docs also. |
Only for your Docs. The Proxy from Rob--W/cors-anywhere works very well with heroku.com |
Hi,
im triyng to connect to the AOI but I get alwasy this issue:
Access to XMLHttpRequest at 'https://api.sandbox.ebay.com/identity/v1/oauth2/token' from origin 'http://localhost:8100' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.
Here is my code:
How I can solve this problem?
The text was updated successfully, but these errors were encountered: