appbaseio / mirage

:art: GUI for simplifying Elasticsearch Query DSL
http://opensource.appbase.io/mirage
Other
2.21k stars 125 forks source link

Can't connect to ES server #34

Closed haizaar closed 7 years ago

haizaar commented 7 years ago

Hi guys,

I'm using hosted version of Mirage: http://opensource.appbase.io/mirage/ on Chrome 53.

It can't connect to my dev server that does not have any auth and has CORS allow origin set to *:

image

Browser console says the following:

XMLHttpRequest cannot load http://example:9200/foobar/_mapping/. Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

However my CORES response welcomes everybody:

Access-Control-Allow-Headers:Content-Type
Access-Control-Allow-Headers:Content-Length
Access-Control-Allow-Headers:X-Requested-With
Access-Control-Allow-Methods:DELETE
Access-Control-Allow-Methods:POST
Access-Control-Allow-Methods:GET
Access-Control-Allow-Methods:PUT
Access-Control-Allow-Methods:HEAD
Access-Control-Allow-Methods:OPTIONS
Access-Control-Allow-Origin:*
Access-Control-Max-Age:1728000
Connection:keep-alive
Content-Length:0
Date:Tue, 06 Dec 2016 11:29:05 GMT
haizaar commented 7 years ago

Probably related: https://github.com/appbaseio/dejavu/issues/47

farhan687 commented 7 years ago

Hey @haizaar Can you make sure you followed following steps: https://github.com/appbaseio/mirage#install-as-elasticsearch-plugin

and try http.cors.allow-origin: "/.*/" instead of just *

haizaar commented 7 years ago

Turns out I've missed allow-headers directive. Now it works wonders. Thank you!