fix(sftp-server): postgre cannot store control characters (#8188 close #8186)

This commit is contained in:
KirCute
2025-03-27 23:14:36 +08:00
committed by GitHub
parent 32890da29f
commit 6e13923225
3 changed files with 10 additions and 6 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin"
"strconv"
"strings"
)
type SSHKeyAddReq struct {
@ -30,7 +31,7 @@ func AddMyPublicKey(c *gin.Context) {
}
key := &model.SSHPublicKey{
Title: req.Title,
KeyStr: req.Key,
KeyStr: strings.TrimSpace(req.Key),
UserId: userObj.ID,
}
err, parsed := op.CreateSSHPublicKey(key)