fix: skip proxy check when disabled (#12388)

Refs #12379
This commit is contained in:
ssongliu
2026-04-01 11:22:08 +00:00
committed by GitHub
parent 8b7597abef
commit 32fed45c1e
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -777,6 +777,7 @@ func checkProxy(req dto.ProxyUpdate) error {
}
transport = http.Transport{DialContext: dialContext}
case "", "close":
return nil
default:
return buserr.WithDetail("ErrNotSupportType", req.ProxyType, nil)
}
+2 -1
View File
@@ -7,6 +7,7 @@ import (
"github.com/1Panel-dev/1Panel/core/app/dto"
"github.com/1Panel-dev/1Panel/core/constant"
"github.com/1Panel-dev/1Panel/core/global"
"github.com/1Panel-dev/1Panel/core/i18n"
"github.com/gin-gonic/gin"
)
@@ -21,7 +22,7 @@ func CSRFTokenGuard() gin.HandlerFunc {
if !global.SESSION.CheckCSRFToken(c, token) {
c.AbortWithStatusJSON(http.StatusForbidden, dto.Response{
Code: http.StatusForbidden,
Message: "invalid request token",
Message: i18n.GetMsgWithMap("ErrNotLogin", map[string]interface{}{"detail": "CSRF token invalid"}),
Data: nil,
})
return
+1 -1
View File
@@ -1658,7 +1658,7 @@ const message = {
clearList: '清空列表',
deleteRecycleHelper: '确定永久删除以下文件',
typeErrOrEmpty: '{0} 文件类型错误或为空文件夹',
dropHelper: '将需要上传的文件拖到此处',
dropHelper: '将需要上传的文件拖到此处',
fileRecycleBin: '文件回收站',
fileRecycleBinMsg: '{0}回收站',
wordWrap: '自动换行',