We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6ddc70 commit 60fc2ccCopy full SHA for 60fc2cc
contrib/proxyprobe/server/main.go
@@ -286,6 +286,7 @@ func handleHTTP(w http.ResponseWriter, r *http.Request) {
286
}
287
288
body, err := io.ReadAll(r.Body)
289
+ defer r.Body.Close()
290
if err != nil {
291
log.Printf("[ERROR] Failed to read request body from %s: %v", r.RemoteAddr, err)
292
http.Error(w, "Failed to read request body", http.StatusInternalServerError)
@@ -302,6 +303,7 @@ func handleHTTP(w http.ResponseWriter, r *http.Request) {
302
303
debugLog("Found matching response")
304
305
306
+ w.Header().Set("Content-Type", "application/json")
307
_, err = w.Write(response)
308
309
log.Printf("[ERROR] Failed to write response to %s: %v", r.RemoteAddr, err)
0 commit comments