1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-28 19:14:13 +08:00

fix: Fix the security entry verification error issue. (#7854)

Refs #7853
This commit is contained in:
ssongliu 2025-02-11 18:13:49 +08:00 committed by GitHub
parent 8bb225d272
commit 036c973fec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,8 +56,8 @@ func (b *BaseApi) UpdateSetting(c *gin.Context) {
return
}
if req.Key == "SecurityEntrance" {
if checkEntrancePattern(req.Value) {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, fmt.Errorf("regexp match string with %s failed", req.Value))
if !checkEntrancePattern(req.Value) {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, fmt.Errorf("the format of the security entrance %s is incorrect.", req.Value))
return
}
}