#!/bin/bash
. testsuite/functions.sh

PORT=12353
run_weborf -b site1 -p $PORT --tar

# Check a subdirectory
curl -s http://127.0.0.1:$PORT/sub1/ | tar -z --list | grep sub1/index.dat

# Check the main directory
curl -s http://127.0.0.1:$PORT/ | tar -z --list | grep sub1/index.dat

# Omit the trailing /, it should redirect and work
curl --follow -s http://127.0.0.1:$PORT/sub1 | tar -z --list | grep sub1/index.dat
curl -s http://127.0.0.1:$PORT/sub1 | tar -z --list | grep sub1/index.dat
