Skip to content

Commit

Permalink
test: gateway response for bafkqaaa
Browse files Browse the repository at this point in the history
Context: #8230
(cherry picked from commit fcfe793)
  • Loading branch information
lidel authored and aschmahmann committed Jul 16, 2021
1 parent d2da666 commit 2788fde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/sharness/t0110-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<meta http-equiv=\"refresh\" content=\"10;url=/ipfs/bafkqaaa?query=to-remember\" />" response_with_double_ipfs_ns &&
Expand Down

0 comments on commit 2788fde

Please sign in to comment.