fix(agent): fix agent host validatation and improve file path handling

This commit is contained in:
yusing
2025-03-29 16:44:16 +08:00
parent 392946fe33
commit be85633c32
3 changed files with 18 additions and 5 deletions

View File

@@ -126,8 +126,8 @@ func VerifyNewAgent(w http.ResponseWriter, r *http.Request) {
return
}
filename := certs.AgentCertsFilename(data.Host)
if !strutils.IsValidFilename(filename) {
filename, ok := certs.AgentCertsFilepath(data.Host)
if !ok {
gphttp.ClientError(w, gphttp.ErrInvalidKey("host"))
return
}