aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-06-03 16:14:40 +0000
committerOmar Polo <op@omarpolo.com>2024-06-03 16:14:40 +0000
commit0a4a979ccbf276c35f7db8df766efcb3e7818093 (patch)
tree4b597afe09f0333fdb2db7697e45493c953d2a2d
parentda834b580366e17fc1a94f9fa9d1737448163717 (diff)
regress: add a check for `fastcgi off' handling across locations
Based on the bug report from Alex, thanks!
-rwxr-xr-xregress/regress1
-rw-r--r--regress/tests.sh29
2 files changed, 30 insertions, 0 deletions
diff --git a/regress/regress b/regress/regress
index 46ac4ef..1cdf3a8 100755
--- a/regress/regress
+++ b/regress/regress
@@ -55,6 +55,7 @@ run_test test_root_inside_location
run_test test_root_inside_location_with_redirect
run_test test_fastcgi
run_test test_fastcgi_inside_location
+run_test test_fastcgi_location_match
run_test test_fastcgi_deprecated_syntax
run_test test_macro_expansion
run_test test_proxy_relay_to
diff --git a/regress/tests.sh b/regress/tests.sh
index 37433ce..58711a3 100644
--- a/regress/tests.sh
+++ b/regress/tests.sh
@@ -292,6 +292,35 @@ test_fastcgi_inside_location() {
return 0
}
+test_fastcgi_location_match() {
+ ./fcgi-test fcgi.sock &
+ fcgi_pid=$!
+
+ setup_simple_test 'prefork 1' '
+ location "/dir/*" {
+ fastcgi off
+ }
+ location "/*" {
+ fastcgi socket "'$PWD'/fcgi.sock"
+ }'
+
+ msg=$(printf "# hello from fastcgi!\nsome more content in the page...")
+ fetch /foo
+ if ! check_reply "20 text/gemini" "$msg"; then
+ kill $fcgi_pid
+ return 1
+ fi
+
+ fetch /dir/foo.gmi
+ if ! check_reply "20 text/gemini" "# hello world"; then
+ kill $fcgi_pid
+ return 1
+ fi
+
+ kill $fcgi_pid
+ return 0
+}
+
test_fastcgi_deprecated_syntax() {
./fcgi-test fcgi.sock &
fcgi_pid=$!