关于DWR的A request has been denied as a potential CSRF attack的错误

简介:

 在web.xml配置文件中修改dwr的配置:

 

 
  1. <servlet>   
  2.  <servlet-name>dwr-invoker</servlet-name>   
  3.   <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>   
  4.   <init-param>   
  5.    <param-name>debug</param-name>   
  6.    <param-value>true</param-value>   
  7.   </init-param>   
  8.   <!-- 新加corssDomainSessionSecurity参数 -->   
  9.   <init-param>      
  10.             <param-name>crossDomainSessionSecurity</param-name>      
  11.             <param-value>false</param-value>      
  12.     </init-param>   
  13.  </servlet>  


据说参数corssDomainSessionSecurity是在dwr版本2.0才有的.默认值为true,也就是禁止其他域发送请求.若设置成false后,就能够从其他域进行请求但这样做会在安全性上有一些冒险.。。

据说的!我也不知道为什么!呵呵,开心学习,一起进步,知识无限!!


本文转自韩立伟 51CTO博客,原文链接:http://blog.51cto.com/hanchaohan/780723,如需转载请自行联系原作者


相关文章
|
4月前
|
前端开发 对象存储 数据安全/隐私保护
阿里云前端直传has been blocked by CORS policy: Response to preflight request doesn‘t pass access control
阿里云前端直传has been blocked by CORS policy: Response to preflight request doesn‘t pass access control
436 2
|
12月前
【异常解决】postman请求提示Full authentication is required to access this resource
【异常解决】postman请求提示Full authentication is required to access this resource
234 0
|
中间件 PHP
POST 419 ; message: “CSRF token mismatch.“, exception: “Symfony\Component\HttpKernel\Exception\HttpE
POST 419 ; message: “CSRF token mismatch.“, exception: “Symfony\Component\HttpKernel\Exception\HttpE
121 0
|
开发工具 数据安全/隐私保护
The request you have made requires authentication. (HTTP 401)
The request you have made requires authentication. (HTTP 401)
1294 0
The request you have made requires authentication. (HTTP 401)
|
应用服务中间件 API nginx
解决跨域问题 Response to preflight request doesn't pass access control check
解决跨域问题 Response to preflight request doesn't pass access control check
11162 1
|
前端开发 PHP
PHP - Laravel @csrf、csrf_field()、csrf_token() 使用
PHP - Laravel @csrf、csrf_field()、csrf_token() 使用
73 0
|
存储 安全 前端开发
message“: “CSRF token mismatch
message“: “CSRF token mismatch
409 0
|
Web App开发 网络安全
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute在这里插入图片描述
2107 0
Detail about CSRF token fetch request
Created by Jerry Wang, last modified on Jun 17, 2015 updateSecurityToken bTokenHandling x-csrf-token oServiceData.securityToken ODataModel._createBatchRequest ODataModel.prototype.refreshSecurityToken
Detail about CSRF token fetch request
|
JSON 缓存 前端开发
修复shiro重定向引起的Response for preflight is invalid (redirect)的网络报错问题
最近集成shiro到项目中,遇到该一个报复Response for preflight is invalid (redirect)的问题。 shiro集成,配置无权限的路径 @Bean(name = "shiroFilter") p...
1678 0