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
90b6490a
Commit
90b6490a
authored
Aug 17, 2015
by
rht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for readonly gateway api sanitation
License: MIT Signed-off-by:
rht
<
rhtbot@gmail.com
>
parent
d07bf899
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
test/sharness/t0110-gateway.sh
test/sharness/t0110-gateway.sh
+13
-2
No files found.
test/sharness/t0110-gateway.sh
View file @
90b6490a
...
...
@@ -92,8 +92,13 @@ test_expect_success "log output looks good" '
'
# test ipfs readonly api
test_curl_gateway_api
()
{
curl
-sfo
actual
"http://127.0.0.1:
$port
/api/v0/
$1
"
}
test_expect_success
"get IPFS directory file through readonly API succeeds"
'
curl -sfo actual "http://127.0.0.1:$port/api/v0/
cat?arg=$HASH2/test"
test_curl_gateway_api "
cat?arg=$HASH2/test"
'
test_expect_success
"get IPFS directory file through readonly API output looks good"
'
...
...
@@ -101,7 +106,13 @@ test_expect_success "get IPFS directory file through readonly API output looks g
'
test_expect_success
"refs IPFS directory file through readonly API succeeds"
'
curl -sfo actual "http://127.0.0.1:$port/api/v0/refs?arg=$HASH2/test"
test_curl_gateway_api "refs?arg=$HASH2/test"
'
test_expect_success
"test gateway api is sanitized"
'
for cmd in "add" "block/put" "bootstrap" "config" "dht" "diag" "dns" "get" "id" "mount" "name/publish" "object/put" "object/new" "object/patch" "pin" "ping" "refs/local" "repo" "resolve" "stats" "swarm" "tour" "file" "update" "version" "bitswap"; do
test_curl_resp_http_code "http://127.0.0.1:$port/api/v0/$cmd" "HTTP/1.1 404 Not Found"
done
'
test_kill_ipfs_daemon
...
...
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