diff --git a/pkg/api/chunk_stream.go b/pkg/api/chunk_stream.go index 4ae045a9d4..2f91939f21 100644 --- a/pkg/api/chunk_stream.go +++ b/pkg/api/chunk_stream.go @@ -14,8 +14,8 @@ import ( "github.com/ethersphere/bee/v2/pkg/jsonhttp" "github.com/ethersphere/bee/v2/pkg/log" "github.com/ethersphere/bee/v2/pkg/postage" - storage "github.com/ethersphere/bee/v2/pkg/storage" - storer "github.com/ethersphere/bee/v2/pkg/storer" + "github.com/ethersphere/bee/v2/pkg/storage" + "github.com/ethersphere/bee/v2/pkg/storer" "github.com/ethersphere/bee/v2/pkg/swarm" "github.com/gorilla/websocket" ) @@ -56,7 +56,8 @@ func (s *Service) chunkUploadStreamHandler(w http.ResponseWriter, r *http.Reques } // if tag not specified use direct upload - putter, err := s.newStamperPutter(r.Context(), putterOptions{ + // Using context.Background here because the putter's lifetime extends beyond that of the HTTP request. + putter, err := s.newStamperPutter(context.Background(), putterOptions{ BatchID: headers.BatchID, TagID: tag, Deferred: tag != 0,