diff --git a/test/sharness/t0110-gateway.sh b/test/sharness/t0110-gateway.sh index 0de68b35c5a..b8b5db4c2c3 100755 --- a/test/sharness/t0110-gateway.sh +++ b/test/sharness/t0110-gateway.sh @@ -301,16 +301,26 @@ test_expect_success "Verify gateway file" ' test_cmp gateway_daemon_actual gateway_file_actual ' -test_expect_success "GET TAR file from gateway and extract" ' +test_expect_success "GET TAR with format=tar and extract" ' curl "http://127.0.0.1:$port/ipfs/$FOO2_HASH?format=tar" | tar -x ' -test_expect_success "GET TAR file has expected Content-Type" ' +test_expect_success "GET TAR with 'Accept: application/x-tar' and extract" ' + curl -H "Accept: application/x-tar" "http://127.0.0.1:$port/ipfs/$FOO2_HASH" | tar -x +' + +test_expect_success "GET TAR with format=tar has expected Content-Type" ' curl -svX GET "http://127.0.0.1:$port/ipfs/$FOO2_HASH?format=tar" > curl_output_filename 2>&1 && cat curl_output_filename && grep "< Content-Type: application/x-tar" curl_output_filename ' +test_expect_success "GET TAR with 'Accept: application/x-tar' has expected Content-Type" ' + curl -svX GET -H "Accept: application/x-tar" "http://127.0.0.1:$port/ipfs/$FOO2_HASH" > curl_output_filename 2>&1 && + cat curl_output_filename && + grep "< Content-Type: application/x-tar" curl_output_filename +' + test_kill_ipfs_daemon GWPORT=32563