Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.
See original GitHub issueI am attempting to make a connection to my Elastic Search. I would like to add in the header ‘Origin’, but SearchkitManager throws the error Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.
My Elasticsearch requires this header, is there any way to allow this header within searchkit
The code:
render() {
const headers = {Authorization: 'user:pw', 'Origin': 'origin-url'}
const searchKitManager = new SearchkitManager('http://url-to-es, {httpHeaders: headers})
return (<SearchkitProvider searchkit={searchKitManager}>
...
</SearchkitProvider>)
Note: I have tried basicAuth.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Request header field Access-Control-Allow-Headers is not ...
Notice the Authorization value for the Access-Control-Allow-Headers key. I was missing the Authorization value, this config solves my issue.
Read more >CORS error: Request header field Authorization is not allowed ...
The CORS error "Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers in preflight response" occurs when your browser ...
Read more >'Request header field authorization is not allowed by Access ...
'Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.' in a POST Request #2345.
Read more >Access-Control-Allow-Headers - HTTP - MDN Web Docs
Although CORS-safelisted request headers are always allowed and don't usually need to be listed in Access-Control-Allow-Headers , listing them ...
Read more >Request header field content-type is ... - Netlify Support Forums
Access to XMLHttpRequest at 'https://XXXX' from origin 'https://XXX' has been blocked by CORS policy: Request header field content-type is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you might need to add Authorization to the allowed cors headers in your ES config
I think the property is http.cors.allow-headers
nice! I will add a note to our docs