Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
08ea56ce
Commit
08ea56ce
authored
May 11, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1191 from ipfs/refactor/httpGateway
Refactor/http gateway
parents
e67c2a7b
4537311f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
core/corehttp/gateway_handler.go
core/corehttp/gateway_handler.go
+3
-5
No files found.
core/corehttp/gateway_handler.go
View file @
08ea56ce
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment