test: gateway response for bafkqaaa
Context: https://github.com/ipfs/go-ipfs/issues/8230 (cherry picked from commit fcfe79333c8789e1399e60f6a729119e90249977)
Marcin Rataj committed
Jun 30, 2021 at 18:54 UTC
2788fde890ad635c0d361cf3b55e5439995b8783
1 file changed
+7
test/sharness/t0110-gateway.sh
+7
@@ -84,6 +84,13 @@ test_expect_success "GET IPFS nonexistent file returns code expected (404)" '
84
test_curl_resp_http_code "http://127.0.0.1:$port/ipfs/$HASH2/pleaseDontAddMe" "HTTP/1.1 404 Not Found"
85
'
86
87
+# https://github.com/ipfs/go-ipfs/issues/8230
88
+test_expect_success "GET IPFS inlined zero-length data object returns ok code (200)" '
89
+ curl -sD - "http://127.0.0.1:$port/ipfs/bafkqaaa" > empty_ok_response &&
90
+ test_should_contain "HTTP/1.1 200 OK" empty_ok_response &&
91
+ test_should_contain "Content-Length: 0" empty_ok_response
92
+'
93
+
94
test_expect_success "GET /ipfs/ipfs/{cid} returns redirect to the valid path" '
95
curl -sD - "http://127.0.0.1:$port/ipfs/ipfs/bafkqaaa?query=to-remember" > response_with_double_ipfs_ns &&
96
test_should_contain "<meta http-equiv=\"refresh\" content=\"10;url=/ipfs/bafkqaaa?query=to-remember\" />" response_with_double_ipfs_ns &&