sparna-git / Sparnatural

Sparnatural : visual knowledge graph explorer with SPARQL, in the browser, configurable with SHACL
http://sparnatural.eu
GNU Lesser General Public License v3.0
225 stars 41 forks source link

CORS issue with flask #608

Closed ch-sander closed 3 months ago

ch-sander commented 3 months ago

I run sparnatural as a flask template with a oxigraph triple store as API endpoint, both in a docker network and container. Flask has CORS enabled, oxigraph is routed via nginx with CORS header.

Problem: I can use the YASGUI widget and query my endpoint (in the index.html of sparnatural). But I cannot use the sparnatural queries, i.e. the lists etc. will not be filled.

It works if I set a public endpoint instead of my localhost:7878/query endpoint.

I don't understand how YASGUI can reach the endpoint while sparnatural cannot.

curl shows a correct header for the flask app (localhost:5000).

I know this is not a a specific sparnatural problem, but maybe you still know a way to solve this.

ch-sander commented 3 months ago

the issue seems that 127.0.0.1:7878 is accepted but localhost:7878is not....

tfrancart commented 3 months ago

If it helps, here is how to pass additionnal headers to the queries being sent by Sparnatural : http://docs.sparnatural.eu/Javascript-integration.html#headers-configuration