Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#1010 from ipfs/fix/pin-bug
Browse files Browse the repository at this point in the history
fix pinning

This commit was moved from ipfs/kubo@b483fdc
  • Loading branch information
jbenet committed Apr 20, 2015
2 parents 5a328d5 + 8db5cd5 commit ca9203b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gateway/core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) {
return
}

rootnd, err := i.node.Resolver.DAG.Get(u.Key(h))
tctx, cancel := context.WithTimeout(ctx, time.Minute)
defer cancel()
rootnd, err := i.node.Resolver.DAG.Get(tctx, u.Key(h))
if err != nil {
webError(w, "Could not resolve root object", err, http.StatusBadRequest)
return
Expand Down Expand Up @@ -414,7 +416,9 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) {
return
}

rootnd, err := i.node.Resolver.DAG.Get(u.Key(h))
tctx, cancel := context.WithTimeout(ctx, time.Minute)
defer cancel()
rootnd, err := i.node.Resolver.DAG.Get(tctx, u.Key(h))
if err != nil {
webError(w, "Could not resolve root object", err, http.StatusBadRequest)
return
Expand Down

0 comments on commit ca9203b

Please sign in to comment.