mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-12 17:46:20 +08:00
feat: 修改csrf作用域
This commit is contained in:
parent
7ef50b6205
commit
d460f0fc3c
1 changed files with 1 additions and 0 deletions
|
@ -12,6 +12,7 @@ import (
|
||||||
func CSRF() gin.HandlerFunc {
|
func CSRF() gin.HandlerFunc {
|
||||||
csrfMd := csrf.Protect(
|
csrfMd := csrf.Protect(
|
||||||
[]byte(global.CONF.Csrf.Key),
|
[]byte(global.CONF.Csrf.Key),
|
||||||
|
csrf.Path("/api"),
|
||||||
csrf.ErrorHandler(http.HandlerFunc(
|
csrf.ErrorHandler(http.HandlerFunc(
|
||||||
func(w http.ResponseWriter, r *http.Request) {
|
func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(http.StatusForbidden)
|
w.WriteHeader(http.StatusForbidden)
|
||||||
|
|
Loading…
Add table
Reference in a new issue