diff --git a/ipxe/http/middleware.go b/ipxe/http/middleware.go index 7792efd4..c43e1d43 100644 --- a/ipxe/http/middleware.go +++ b/ipxe/http/middleware.go @@ -49,8 +49,11 @@ func (w *responseWriter) Write(b []byte) (int, error) { w.statusCode = 200 } n, err := w.ResponseWriter.Write(b) + if err != nil { + return 0, fmt.Errorf("failed writing response: %w", err) + } - return n, fmt.Errorf("writing response: %w", err) + return n, nil } func (w *responseWriter) WriteHeader(code int) {