mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 11:27:42 +08:00
gateway: on api, restrict to webui
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
This commit is contained in:
parent
2df8dc5a88
commit
39bef0d5b0
@ -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/"),
|
||||
|
||||
@ -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 &&
|
||||
|
||||
Loading…
Reference in New Issue
Block a user