freme-project / basic-services

Apache License 2.0
0 stars 1 forks source link

Migrate CORS filter to a basic service #23

Closed jnehring closed 8 years ago

jnehring commented 8 years ago

done. next step: add this to the new freme broker

jnehring commented 8 years ago

done

bjdmeest commented 8 years ago

When executing the following code, first a HTTP OPTIONS is triggered, which takes >30s, after which the HTTP POST fails because No 'Access-Control-Allow-Origin' header is present on the requested resource

$.ajax({
               method: 'POST',
               headers: {'Content-Type': 'text/html', Accept: 'text/n3'},
               data: '<p>Dissident Chinese artist Ai Weiwei has been refused a six-month visa by the British government amid claims he lied on his visa application form. Ai posted a letter on Instagram stating his entry to the UK had been restricted because he failed to declare his "criminal conviction". But Ai, though detained in China for 81 days in 2011, has never been charged or convicted of a crime in China. The artist was granted a 20-day visa to attend the opening of his London show.</p>',
               url: 'http://api.freme-project.eu/current/e-entity/freme-ner/documents?informat=text%2Fhtml&outformat=text%2Fhtml&language=en&dataset=dbpedia&mode=all'
           })
           .done(function(res) {console.log(JSON.stringify(res))})
           .fail(function(err) {console.log(JSON.stringify(err))});
jnehring commented 8 years ago

@bjdmeest I think you were using the CORS filter already for some time, e.g. in the CKEditor plugin, and it did not make problems. Am I right?

@ArneBinder please try to reproduce the error and give a recommendation on how to proceed.

bjdmeest commented 8 years ago

Yes, indeed. I think it might be a problem with the OPTIONS request not completing well.

ArneBinder commented 8 years ago

There was a problem with our server, @bjdmeest please have a look if the problem is solved and close this ticket, otherwise reassign to me.

bjdmeest commented 8 years ago

Fixed, thanks!