dromara / sureness

A simple and efficient security framework that focus on protection of API.

Home Page:https://usthe.com/sureness

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

对于DELETE请求会提示“Invalid CORS request”

lwhua opened this issue · comments

commented

添加了sureness后,通过jquery发送delete请求会提示“Invalid CORS request”,通过curl命令发送delete请求也正常,get和post请求正常,spring boot 已经配置跨域,请问是不是sureness导致的?

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After adding sureness, it will prompt "Invalid CORS request" for delete request, get and post requests are normal, is it caused by sureness?

这是跨域问题,sureness不会返回这个,按道理不会是sureness造成 你可以在filter入口debug下呢

跨域问题一般解决方式,后端添加支持跨域即可 之前的代码,应该还能用

commented

这是跨域问题,sureness不会返回这个,按道理不会是sureness造成 你可以在filter入口debug下呢

跨域问题一般解决方式,后端添加支持跨域即可 之前的代码,应该还能用

filter入口有接收到delete请求,请求是通过Nginx代理到后端服务

试试将sureness相关的那个filter禁用来排除,curl是好的那就是jquery的跨域问题了。用jquery调用后台有啥报错么,建议对比不同方式下请求头和响应头有啥区别 不介意的话帖一波我也看看

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Try to disable the filter related to sureness to exclude it. If curl is good, it is the cross-domain problem of jquery. Is there any error reported when calling the background with jquery? It is recommended to compare the difference between request header and response header in different ways.