This commit is contained in:
2026-01-02 18:20:15 +00:00
parent 0f7c29c3ef
commit ce5a8fbffd
37 changed files with 323 additions and 178 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ func HandleUpstreamError(w http.ResponseWriter, err error, url, context string)
func CheckUpstreamStatus(statusCode int, body io.ReadCloser) error {
if statusCode != http.StatusOK {
if body != nil {
body.Close()
body.Close() // #nosec G104 -- Cleanup, error not critical
}
return fmt.Errorf("upstream returned status %d", statusCode)
}
+1 -1
View File
@@ -46,7 +46,7 @@ func FetchFromUpstream(
// WriteResponse writes the cache entry data to the HTTP response writer
// Sets appropriate content type and handles errors
func WriteResponse(w http.ResponseWriter, entry *cache.CacheEntry, contentType string) error {
defer entry.Data.Close()
defer entry.Data.Close() // #nosec G104 -- Cleanup, error not critical
w.Header().Set("Content-Type", contentType)
if _, err := io.Copy(w, entry.Data); err != nil {