I\'m attempting to communicate with Domino via REST via a cross domain request, but I\'m encountering an issue. I\'ve setup an Internet Site document with the IP Address, lo
I think your configuration is fine and you can test it using CURL . You should be able to see the Custom Headers by checking any URL different to the one you're using.
The problem, maybe, is due to the XPages Extension Library control, REST Service, you're using. I think the "HTTP response headers" are not applied for this control. I've tested it in Domino 8.5.3
The CORS header is part of the response, so you need to check if you get a CORS response header with your page. In any case, for an XPage you can get direct access to the servlet response object and set the header in your XPage:
var externalContext = facesContext.getExternalContext();
var response = externalContext.getResponse();
response.setHeader("Access-Control-Allow-Origin","*");
You want to replace the *
with a little more restrictive setting. Cors doesn't work in all browsers, so you need to check that end too.
I know this is kinda old thread but since it's not being answered and there are some news, I think it's worth throwing in my own findings.
However, I'm also struggling on completing a CORS task currently, because Domino always responds with an 401 to the preflight (which seems clear as it comes unauthenticated, at least within Chrome).