How do I setup CORS on Lotus Domino?

后端 未结 3 1474
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 15:08

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

3条回答
  •  不知归路
    2021-01-14 15:25

    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.

提交回复
热议问题