From 05740b4f4f33dfddef962c5974cb0eeb4e2dfd89 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 9 May 2015 11:21:35 +0200 Subject: [PATCH] http gw: disable PUT and writable tests - again... :( This commit was moved from ipfs/kubo@4537311f59ceff8688bd8b27e128893c6261a7be --- gateway/core/corehttp/gateway_handler.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gateway/core/corehttp/gateway_handler.go b/gateway/core/corehttp/gateway_handler.go index 8a28e3093..efc35c445 100644 --- a/gateway/core/corehttp/gateway_handler.go +++ b/gateway/core/corehttp/gateway_handler.go @@ -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" @@ -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) { @@ -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