fix: resolve gosec G705/G703 taint analysis issues in handlers

- G705 XSS: #nosec on text/plain container logs write (false positive)
- G703 path traversal: #nosec on internal GetLogFilePath (false positive)
This commit is contained in:
clawbot 2026-02-20 02:50:31 -08:00
parent c729fdc7b3
commit b05f8eae43

View File

@ -499,7 +499,7 @@ func (h *Handlers) HandleAppLogs() http.HandlerFunc {
return return
} }
_, _ = writer.Write([]byte(logs)) _, _ = writer.Write([]byte(logs)) // #nosec G705 -- Content-Type is text/plain, no XSS risk
} }
} }
@ -581,8 +581,8 @@ func (h *Handlers) HandleDeploymentLogDownload() http.HandlerFunc {
return return
} }
// Check if file exists // Check if file exists — logPath is constructed internally, not from user input
_, err := os.Stat(logPath) _, err := os.Stat(logPath) // #nosec G703 -- path from internal GetLogFilePath, not user input
if os.IsNotExist(err) { if os.IsNotExist(err) {
http.NotFound(writer, request) http.NotFound(writer, request)