From ab49e18d53c65f65f67aaf2bd15430a6cbb9346e Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 30 Jun 2021 18:54:12 +0200 Subject: [PATCH] test: gateway response for bafkqaaa Context: https://github.com/ipfs/go-ipfs/issues/8230 --- test/sharness/t0110-gateway.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/sharness/t0110-gateway.sh b/test/sharness/t0110-gateway.sh index cdeeaae6d23c..8bd7937eec07 100755 --- a/test/sharness/t0110-gateway.sh +++ b/test/sharness/t0110-gateway.sh @@ -84,6 +84,13 @@ test_expect_success "GET IPFS nonexistent file returns code expected (404)" ' test_curl_resp_http_code "http://127.0.0.1:$port/ipfs/$HASH2/pleaseDontAddMe" "HTTP/1.1 404 Not Found" ' +# https://github.com/ipfs/go-ipfs/issues/8230 +test_expect_success "GET IPFS inlined zero-length data object returns ok code (200)" ' + curl -sD - "http://127.0.0.1:$port/ipfs/bafkqaaa" > empty_ok_response && + test_should_contain "HTTP/1.1 200 OK" empty_ok_response && + test_should_contain "Content-Length: 0" empty_ok_response +' + test_expect_success "GET /ipfs/ipfs/{cid} returns redirect to the valid path" ' curl -sD - "http://127.0.0.1:$port/ipfs/ipfs/bafkqaaa?query=to-remember" > response_with_double_ipfs_ns && test_should_contain "" response_with_double_ipfs_ns &&