From e873cca2df0c8897512ae14e63d70b07d198525b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Sat, 12 Mar 2022 21:50:52 +0800 Subject: [PATCH] nested exit test --- conf/local_macos/test.conf | 4 ++++ test_scripts/nested_exit.lua | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test_scripts/nested_exit.lua diff --git a/conf/local_macos/test.conf b/conf/local_macos/test.conf index bff4743..a1e0dd7 100644 --- a/conf/local_macos/test.conf +++ b/conf/local_macos/test.conf @@ -17,5 +17,9 @@ server { location /api/ngx/test/uri { content_by_lua_file $resty_loc/nginx/scripts/tests/uri.lua; } + + location /api/ngx/test/nested_exit { + content_by_lua_file $resty_loc/nginx/scripts/tests/nested_exit.lua; + } } diff --git a/test_scripts/nested_exit.lua b/test_scripts/nested_exit.lua new file mode 100644 index 0000000..22cd3fa --- /dev/null +++ b/test_scripts/nested_exit.lua @@ -0,0 +1,10 @@ +local function nested_e() + ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) +end + +nested_e() +ngx.say("OK") + +-- ➤ curl test.localhost:8088/api/ngx/test/nested_exit + +