add sharness test for index.html content type
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Jan 1, 2016 at 14:31 UTC
cb1c5c535cb27462c0c326ed85acc01d03e7f243
1 file changed
+15
test/sharness/t0110-gateway.sh
+15
@@ -92,6 +92,21 @@ test_expect_success "log output looks good" '
92
grep "log API client connected" log_out
93
'
94
95
+test_expect_success "setup index hash" '
96
+ mkdir index &&
97
+ echo "<p></p>" > index/index.html &&
98
+ INDEXHASH=$(ipfs add -q -r index | tail -n1)
99
+ echo index: $INDEXHASH
100
+'
101
+
102
+test_expect_success "GET 'index.html' has correct content type" '
103
+ curl -I "http://127.0.0.1:$port/ipfs/$INDEXHASH/" > indexout
104
+'
105
+
106
+test_expect_success "output looks good" '
107
+ grep "Content-Type: text/html" indexout
108
+'
109
+
110
# test ipfs readonly api
111
112
test_curl_gateway_api() {