Skip to content

Commit

Permalink
regress: add a check for `fastcgi off' handling across locations
Browse files Browse the repository at this point in the history
Based on the bug report from Alex, thanks!
  • Loading branch information
omar-polo committed Jun 3, 2024
1 parent da834b5 commit 0a4a979
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions regress/regress
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions regress/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$!
Expand Down

0 comments on commit 0a4a979

Please sign in to comment.