Skip to content

Commit

Permalink
agent/fileserver: Fix lint errcheck
Browse files Browse the repository at this point in the history
This commit fix the lint error errcheck when writing the content of the
index file into the ResponseWriter is not handled.
  • Loading branch information
tupyy committed Oct 16, 2024
1 parent f7e87ad commit 5ae9414
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/agent/fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func handleGetLogin(log *log.PrefixLogger, wwwDir string) http.HandlerFunc {

w.Header().Set("Content-Type", "text/html")
w.Header().Set("Content-Length", strconv.Itoa(len(file)))
w.Write(file)
if _, err := w.Write(file); err != nil {
log.Warnf("Failed writing the content of %s", pathToIndeHtml)
}
}
}

0 comments on commit 5ae9414

Please sign in to comment.