美文网首页
springboot security csrf拒绝post请求

springboot security csrf拒绝post请求

作者: wangzaiplus | 来源:发表于2017-09-05 08:08 被阅读0次

项目框架:springboot+spring security4+thmyeleaf

解决security拒绝post请求方法:
<head></head>中添加:

 <meta name="_csrf" th:content="${_csrf.token}"/>
 <meta name="_csrf_header" th:content="${_csrf.headerName}"/>

同时注意,form表单应该使用th:action,而不是action

相关文章

网友评论

      本文标题:springboot security csrf拒绝post请求

      本文链接:https://www.haomeiwen.com/subject/dznulxtx.html