Skip to content

Commit 46792a3

Browse files
committed
Merge pull request ipfs/kubo#1585 from rht/cleanup-context
Make sure ctx in commands are derived from req.Context This commit was moved from ipfs/kubo@a965316
2 parents a6aa610 + f08edeb commit 46792a3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

gateway/core/corehttp/gateway_handler.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,7 @@ func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) {
367367
}
368368
}
369369

370-
err = i.node.DAG.AddRecursive(newnode)
371-
if err != nil {
370+
if err := i.node.DAG.AddRecursive(newnode); err != nil {
372371
webError(w, "Could not add recursively new node", err, http.StatusInternalServerError)
373372
return
374373
}
@@ -439,8 +438,7 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) {
439438
}
440439
}
441440

442-
err = i.node.DAG.AddRecursive(newnode)
443-
if err != nil {
441+
if err := i.node.DAG.AddRecursive(newnode); err != nil {
444442
webError(w, "Could not add recursively new node", err, http.StatusInternalServerError)
445443
return
446444
}

0 commit comments

Comments
 (0)