Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#1191 from ipfs/refactor/httpGateway
Browse files Browse the repository at this point in the history
Refactor/http gateway

This commit was moved from ipfs/kubo@08ea56c
  • Loading branch information
jbenet committed May 11, 2015
2 parents 6a5bc0f + 05740b4 commit 2a396c5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gateway/core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"strings"
"time"

mh "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"

core "github.com/ipfs/go-ipfs/core"
Expand Down Expand Up @@ -234,9 +233,8 @@ func (i *gatewayHandler) postHandler(w http.ResponseWriter, r *http.Request) {
return
}

h := mh.Multihash(k).B58String()
w.Header().Set("IPFS-Hash", h)
http.Redirect(w, r, ipfsPathPrefix+h, http.StatusCreated)
w.Header().Set("IPFS-Hash", k.String())
http.Redirect(w, r, ipfsPathPrefix+k.String(), http.StatusCreated)
}

func (i *gatewayHandler) putEmptyDirHandler(w http.ResponseWriter, r *http.Request) {
Expand All @@ -253,7 +251,7 @@ func (i *gatewayHandler) putEmptyDirHandler(w http.ResponseWriter, r *http.Reque
}

func (i *gatewayHandler) putHandler(w http.ResponseWriter, r *http.Request) {
// TODO(cryptix): will be resolved in PR#1191
// TODO(cryptix): either ask mildred about the flow of this or rewrite it
webErrorWithCode(w, "Sorry, PUT is bugged right now, closing request", errors.New("handler disabled"), http.StatusInternalServerError)
return
urlPath := r.URL.Path
Expand Down

0 comments on commit 2a396c5

Please sign in to comment.