add a test for the `proxy relay-to' rule

This commit is contained in:
Omar Polo 2021-12-29 20:36:54 +00:00
parent c143dcfa85
commit 4b5b1e82a9
2 changed files with 19 additions and 0 deletions

View File

@ -51,5 +51,6 @@ run_test test_root_inside_location_with_redirect
run_test test_fastcgi
run_test test_macro_expansion
run_test test_174_bugfix
run_test test_proxy_relay_to
tests_done

View File

@ -313,3 +313,21 @@ test_174_bugfix() {
check_reply "51 not found" || return 1
done
}
test_proxy_relay_to() {
gen_config '' ''
# append config for second host
cat <<EOF >> reg.conf
server "localhost.local" {
cert "$PWD/cert.pem"
key "$PWD/key.pem"
proxy relay-to "localhost:$port"
}
EOF
run
gg_flags="-P localhost:$port -H localhost.local"
fetch /
check_reply "20 text/gemini" "# hello world"
}