test(gw): index.html with go-get=1
This adds a missing test for https://github.com/ipfs/kubo/pull/3963
Marcin Rataj committed
Jul 19, 2022 at 01:32 UTC
c95f5c9fce3651e308ece121f8603e820a611d6b
1 file changed
+7
test/sharness/t0110-gateway.sh
+7
@@ -75,6 +75,13 @@ test_expect_success "GET IPFS directory with index.html returns redirect to add
75
test_should_contain \"Location: /ipfs/$HASH2/dirwithindex/?query=to-remember\" response_without_slash
76
"
77
78
+# This enables go get to parse go-import meta tags from index.html files stored in IPFS
79
+# https://github.com/ipfs/kubo/pull/3963
80
+test_expect_success "GET IPFS directory with index.html and no trailing slash returns expected output when go-get is passed" "
81
+ curl -s -o response_with_slash \"http://127.0.0.1:$port/ipfs/$HASH2/dirwithindex?go-get=1\" &&
82
+ test_should_contain \"hello i am a webpage\" response_with_slash
83
+"
84
+
85
test_expect_success "GET IPFS directory with index.html and trailing slash returns expected output" "
86
curl -s -o response_with_slash \"http://127.0.0.1:$port/ipfs/$HASH2/dirwithindex/?query=to-remember\" &&
87
test_should_contain \"hello i am a webpage\" response_with_slash