fix security issues

This commit is contained in:
2025-03-16 13:47:40 +02:00
parent 7603f9395a
commit 837c5863fd
2 changed files with 10 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
@@ -30,5 +31,9 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) {
return
}
w.WriteHeader(code)
w.Write(dat)
_, err = w.Write(dat)
if err != nil {
fmt.Printf("Error wiring response: %s", err.Error())
return
}
}