Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jun 9, 2022
1 parent a568865 commit 62017aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/sharness/t0117-gateway-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ test_expect_success "Create text fixtures" '
grep "< X-Content-Type-Options: nosniff" curl_output
'

test_expect_success "GET for application/vnd.ipld.raw with query filename includes Content-Disposition with custom filename" '
curl -svX GET -H "Accept: application/vnd.ipld.raw" "http://127.0.0.1:$GWAY_PORT/ipfs/$ROOT_DIR_CID/dir/ascii.txt&filename=foobar.bin" >/dev/null 2>curl_output_filename &&
cat curl_output_filename &&
grep "< Content-Disposition: attachment\; filename=\"foobar.bin\"" curl_output_filename
'

# Cache control HTTP headers
# (basic checks, detailed behavior is tested in t0116-gateway-cache.sh)

Expand Down
3 changes: 2 additions & 1 deletion test/sharness/t0118-gateway-car.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ test_launch_ipfs_daemon_without_network

test_expect_success "GET for application/vnd.ipld.car with query filename includes Content-Disposition with custom filename" '
curl -svX GET -H "Accept: application/vnd.ipld.car" "http://127.0.0.1:$GWAY_PORT/ipfs/$ROOT_DIR_CID/subdir/ascii.txt?filename=foobar.car" > curl_output_filename 2>&1 &&
grep "< Content-Disposition: attachment; filename=\"foobar.car\"" curl_output
cat curl_output_filename &&
grep "< Content-Disposition: attachment\; filename=\"foobar.car\"" curl_output_filename
'

# Cache control HTTP headers
Expand Down

0 comments on commit 62017aa

Please # to comment.