mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
feat: 修改csrf作用域
This commit is contained in:
parent
16727105c4
commit
6ab24989fb
@ -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…
x
Reference in New Issue
Block a user