diff --git a/api/server/router/container/container_routes.go b/api/server/router/container/container_routes.go index bb560cb994..7a07753e00 100644 --- a/api/server/router/container/container_routes.go +++ b/api/server/router/container/container_routes.go @@ -940,9 +940,11 @@ func (s *containerRouter) postContainersAttach(ctx context.Context, w http.Respo if multiplexed && versions.GreaterThanOrEqualTo(httputils.VersionFromContext(ctx), "1.42") { contentType = types.MediaTypeMultiplexedStream } - fmt.Fprintf(conn, "HTTP/1.1 101 UPGRADED\r\nContent-Type: "+contentType+"\r\nConnection: Upgrade\r\nUpgrade: tcp\r\n\r\n") + // FIXME(thaJeztah): we should not ignore errors here; see https://github.com/moby/moby/pull/48359#discussion_r1725562802 + fmt.Fprintf(conn, "HTTP/1.1 101 UPGRADED\r\nContent-Type: %v\r\nConnection: Upgrade\r\nUpgrade: tcp\r\n\r\n", contentType) } else { - fmt.Fprintf(conn, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") + // FIXME(thaJeztah): we should not ignore errors here; see https://github.com/moby/moby/pull/48359#discussion_r1725562802 + fmt.Fprint(conn, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") } go notifyClosed(ctx, conn, cancel) diff --git a/api/server/router/image/image_routes.go b/api/server/router/image/image_routes.go index 4550507680..67db9097f7 100644 --- a/api/server/router/image/image_routes.go +++ b/api/server/router/image/image_routes.go @@ -141,7 +141,7 @@ func (ir *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrit id, progressErr = ir.backend.ImportImage(ctx, tagRef, platform, comment, layerReader, r.Form["changes"]) if progressErr == nil { - output.Write(streamformatter.FormatStatus("", id.String())) + _, _ = output.Write(streamformatter.FormatStatus("", "%v", id.String())) } } if progressErr != nil {