From 45051b43eeac531261286d19e9d6520767df85e1 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 8 Aug 2026 20:20:56 +0000 Subject: [PATCH] fix(hermes): The lookup accepts exactly the same ASCII letters, digits, underscore, and hyphen as the original predicate, without altering sanitization behavior. It is a localized one-line source change that reduces the method's cognitive complexity. (incident sonar/pegasus/go:S3776/AZ4V2tkdqCRMjDT4bXBr) --- backend/uploads.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/uploads.go b/backend/uploads.go index 20d88f7..5d9ddc5 100644 --- a/backend/uploads.go +++ b/backend/uploads.go @@ -28,7 +28,7 @@ func sanitizeDescriptor(s string) string { var b []rune lastUnderscore := false for _, r := range s { - ok := (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '_' || r == '-' + ok := strings.ContainsRune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-", r) if !ok { r = '_' } -- 2.47.2