3

Everything in the question.
Additional info:

  • Working with Win 10, GraphDB free, 9.1.1 • RDF4J 3.0.1 • Connectors 12.0.2
  • I added in console => settings, graphdb.workbench.cors.enable / true + Set + restart
  • I also tried to set parameter "-Dgraphdb.workbench.cors.enable=true" under[ArgOptions] of file C:\Users\admin\AppData\Local\GraphDB Free\app\GraphDB Free.cfg + restart

and I still get "Access to fetch at 'http://localhost:7200/repositories/...from origin 'http://localhost:8080' has been blocked by CORS policy...

Okilele
  • 85
  • 1
  • 5
  • What’s the HTTP status code of the response? You can use the Network pane in browser devtools to check. Is it a 4xx or 5xx error rather than a 200 OK success response? – sideshowbarker Feb 10 '20 at 02:25

2 Answers2

9

The quickest way to enable the CORS functionality is to use these two Java parameters: ./graphdb -Dgraphdb.workbench.cors.enable=true -Dgraphdb.workbench.cors.origin=* Alternatively, you can add them to graphdb.in.sh / graphdb.in.cmd. To check what's the active configuration see:

Help > System information > Configuration parameters in the Workbench

Sava Savov
  • 551
  • 2
  • 4
0

On Windows, I edited the file app\GraphDB.cfg and added those lines:

java-options=-Dgraphdb.workbench.cors.enable=true
java-options=-Dgraphdb.workbench.cors.origin=*

under the [JavaOptions] heading.

Then, rerunning GraphDB, and checking at http://localhost:7200/sysinfo should show, in the third tab "Config parameters", that CORS is indeed enabled:

graphdb.workbench.cors.enable          true   explicit 

graphdb.workbench.cors.expose-headers         default  

graphdb.workbench.cors.origin          *      explicit 
lOlive
  • 209
  • 1
  • 5