diff classical/urispace/urispace.pl @ 27:d95e683fbd35 tip

Enable CORS on urispace redirects as well
author Chris Cannam
date Tue, 20 Feb 2018 14:52:02 +0000
parents 91b5145fff34
children
line wrap: on
line diff
--- a/classical/urispace/urispace.pl	Tue Feb 20 13:41:09 2018 +0000
+++ b/classical/urispace/urispace.pl	Tue Feb 20 14:52:02 2018 +0000
@@ -1,17 +1,19 @@
 :- module(urispace,[init/0]).
 
-
 :- use_module(library('http/thread_httpd')).
+:- use_module(library('http/http_cors')).
 :- use_module(library('semweb/rdf_db')).
 :- use_module(log).
 :- use_module(config).
 :- use_module(mapping).
 
+:- set_setting_default(http:cors, [*]).
+
+
 server(Port, Options) :-
         http_server(reply,[ port(Port),timeout(20)| Options]).
 
 
-
 /**
   * Closes the servlet
   */
@@ -37,6 +39,7 @@
 	!,
 	concat_atom(RedirectP,Redirect),
 	log:log('Sending a 303 towards ~w',Redirect),
+        cors_enable,
 	throw(http_reply(see_other(Redirect),[])).
 
 accept_rdf('application/rdf+xml').
@@ -58,6 +61,7 @@
         !,
         concat_atom(RedirectP,Redirect),
         log:log('Sending a 303 towards ~w',Redirect),
+        cors_enable,
         throw(http_reply(see_other(Redirect),[])).
 
 init :-