Skip to content

Commit

Permalink
gateway: on api, restrict to webui
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
  • Loading branch information
Lars Gierth committed Jul 6, 2016
1 parent 2df8dc5 commit 39bef0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func serveHTTPApi(req cmds.Request) (error, <-chan error) {
corehttp.MetricsCollectionOption("api"),
corehttp.CommandsOption(*req.InvocContext()),
corehttp.WebUIOption,
corehttp.GatewayOption("/ipfs", "/ipns"),
corehttp.GatewayOption(corehttp.WebUIPaths...),
corehttp.VersionOption(),
defaultMux("/debug/vars"),
defaultMux("/debug/pprof/"),
Expand Down
4 changes: 4 additions & 0 deletions test/sharness/t0110-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ test_expect_success "GET IPFS path output looks good" '
rm actual
'

test_expect_success "GET IPFS path on API unavailable" '
test_curl_resp_http_code "http://127.0.0.1:$apiport/ipfs/$HASH" "HTTP/1.1 404 Not Found"
'

test_expect_success "GET IPFS directory path succeeds" '
mkdir dir &&
echo "12345" >dir/test &&
Expand Down

0 comments on commit 39bef0d

Please sign in to comment.