fix: server.go pathType validates agent by Name not ID
This commit is contained in:
parent
19690d0ef5
commit
9acc609db5
|
|
@ -572,12 +572,9 @@ func (s *Server) pathType(path string) string {
|
|||
if len(parts) == 2 {
|
||||
return "dir"
|
||||
}
|
||||
// Validate agent ID
|
||||
expectedID := sess.Core.Agent().ID()
|
||||
if expectedID == "" {
|
||||
expectedID = "0"
|
||||
}
|
||||
if parts[2] != expectedID {
|
||||
// Validate agent Name
|
||||
agentName := sess.Core.Agent().Name()
|
||||
if agentName == "" || parts[2] != agentName {
|
||||
return ""
|
||||
}
|
||||
// /session/{id}/agent/{aid} — directory
|
||||
|
|
|
|||
Loading…
Reference in New Issue