如何在Lotus Domino上设置CORS? [英] How do I setup CORS on Lotus Domino?

查看:101
本文介绍了如何在Lotus Domino上设置CORS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过跨域请求通过REST与Domino通信,但是遇到问题.我已经设置了一个Internet站点文档,其中包含IP地址,本地主机和服务器名称作为主机名.该互联网站点正在作为重定向规则运行,我在该互联网站点上设置的正在运行.我还使用以下内容设置了网站规则:

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, localhost and a server name listed as the host names. The internet site is working as a redirect rule I've setup on that internet site is working. I've also setup a Web Site Rule with the following:

现在,当我尝试通过html GET请求访问rest.xsp页面时,出现此错误:

Now when I attempt to hit the rest.xsp page via an html GET request I'm getting this error:

    XMLHttpRequest cannot load 
http://192.168.1.104/testing/restService.nsf/rest.xsp/testRest?reqType=UserCanAc…TOP&startId=BA4241EC74912860ED60FD1123473BF7&returnType=ARRAYOBJECTS. 
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 
'http://127.0.0.1:8020' is therefore not allowed access.

以下是请求标头:

Accept:application/json, text/javascript, */*; q=0.01
Cache-Control:max-age=0
Origin:http://127.0.0.1:8020
Referer:http://127.0.0.1:8020/Backbone%20Playground/index.html
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

我无法为自己的生活弄清楚我错过了什么.有人可以指出我正确的方向吗?

I can't for the life of me figure out what I've missed. Can someone point me in the right direction?

推荐答案

我知道这是一个老话题,但是由于没有得到答复并且有一些新闻,我认为值得把我自己的发现扔进去.

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.

  1. Mark Leusink 陷入其中,发现有必要同时接受GET和201的返回代码204也适用于任何写(PUT/POST)操作
  2. 现在有一种新的可能性,可以通过notes.ini参数"HTTPAdditionalRespHeader =,在所有网站规则中包含第四个响应标头,请参见此
  1. Mark Leusink caved into this and discovered that there's a need to accept also return code 204 for GET and 201 also for any write (PUT / POST) operations
  2. There is now a new possibility to include a fourth Response Header to all website rules by the means of notes.ini parameter "HTTPAdditionalRespHeader=", see this technote

但是,我现在也正在努力完成CORS任务,因为Domino总是以401响应预检(这似乎很清楚,因为未经身份验证,至少在Chrome中是如此).

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).

这篇关于如何在Lotus Domino上设置CORS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆