@cryptotaxi247 / kubo / commits / 39bef0d5b

gateway: on api, restrict to webui

License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>

Lars Gierth committed Jul 7, 2016 at 01:44 UTC 39bef0d5b01f70abf679fca2c4d078a2d55620e2
2 files changed +5 -1
cmd/ipfs/daemon.go
+1 -1
@@ -367,7 +367,7 @@ func serveHTTPApi(req cmds.Request) (error, <-chan error) {
367 corehttp.MetricsCollectionOption("api"),
368 corehttp.CommandsOption(*req.InvocContext()),
369 corehttp.WebUIOption,
370 - corehttp.GatewayOption("/ipfs", "/ipns"),
370 + corehttp.GatewayOption(corehttp.WebUIPaths...),
371 corehttp.VersionOption(),
372 defaultMux("/debug/vars"),
373 defaultMux("/debug/pprof/"),
test/sharness/t0110-gateway.sh
+4
@@ -32,6 +32,10 @@ test_expect_success "GET IPFS path output looks good" '
32 rm actual
33 '
34
35 +test_expect_success "GET IPFS path on API unavailable" '
36 + test_curl_resp_http_code "http://127.0.0.1:$apiport/ipfs/$HASH" "HTTP/1.1 404 Not Found"
37 +'
38 +
39 test_expect_success "GET IPFS directory path succeeds" '
40 mkdir dir &&
41 echo "12345" >dir/test &&