1
KYLINZZ 2019 年 6 月 4 日
带 cookie 的就不能为*,需要写上对应的 ip+端口号
|
2
ClancyH OP @KYLINZZ 我知道,但是这个 tomcat 的 corsfilter 没有做吗?我之前用的时候没有做特殊的配置就正常的配一下 corsfilter 一样正常运行的同样是有 cookie 的
|
3
JohnZorn 2019 年 6 月 4 日 via Android
应该是 allow credentials 设置为了 true,这种可以将其调为 false,或从请求中获取到 ip 设置在 access-con....-origin 中
|
4
ClancyH OP @choice4 allow credentials 不是默认 false 吗,我用的默认值,从请求获取 ip 在设置就是自己实现具体 filter,这个没问题,主要想知道为什么这次 tomcat 的 corsfilter 没有动态设置 origin,是使用姿势不对还是咋地
|
5
cccy0 2019 年 6 月 4 日
allow credentials == true 和 Access-Control-Allow-Origin * 不能同时存在
|
7
youngfish 2019 年 6 月 5 日
CorsFilter 中的 origin 我们当时是通过配置文件实现的,需要添加域名,改配置文件就行了
|
8
wc951 2019 年 6 月 5 日 via Android
spring 的 corsfilter 会在 allow credentials 为 true 且 allow
origin 为*的时候把 Access-Control-Allow-Origin 设置为 request origin |