Spring Rest-API-403禁止错误响应

Spring Rest-API-403禁止错误响应,第1张

Spring Rest-API-403禁止错误响应

只需在web.xml中添加这些过滤器即可

<filter>        <filter-name>CorsFilter</filter-name>        <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>        <init-param> <param-name>cors.allowed.origins</param-name> <param-value>*</param-value>        </init-param>        <init-param> <param-name>cors.allowed.headers</param-name> <param-value>Content-Type,X-Requested-With,accept,authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>        </init-param>        <init-param>        <param-name>cors.allowed.methods</param-name>        <param-value>GET, POST, PUT, DELETE, OPTIONS, HEAD</param-value>    </init-param>    </filter>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5427140.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-11
下一篇 2022-12-11

发表评论

登录后才能评论

评论列表(0条)

保存