Hi,
Can this CXF filter help ? :
https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java;h=5c15836ca717b45ce832c5f80d8d766121f2216a;hb=HEAD
Annotations based approach is also possible.
May be a -cors option can be passed to Tika Server which will react to
it by registering a CORS filter setup with the custom CORS properties ?
Sergey
On 24/03/15 22:41, Tyler Palsulich wrote:
Hi Folks,
I took a stab at creating an example website to submit a file to the form
resource of our VM. See http://tpalsulich.github.io/TikaExamples/.
If I try to use AJAX to submit the request to make the page prettier (see
the script in the head of the page (with ev.preventDefault() commented
out), I get the following error:
XMLHttpRequest cannot load http://162.242.228.174:9998/tika/form. No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://tpalsulich.github.io' is therefore not allowed access. The
response had HTTP status code 400.
We can't allow the tika-server response header to accept "*" in general,
since that isn't secure. So, would there be interest in including this sort
of site on the VM? Then, the AJAX request won't be external and we won't
have this error.
The version button just takes you to the version resource on the VM
(doesn't do anything with the file).
Tyler