diff --git a/test/conf/nginx.conf b/test/conf/nginx.conf index 71c55706..57500710 100644 --- a/test/conf/nginx.conf +++ b/test/conf/nginx.conf @@ -795,6 +795,7 @@ http { Nginx.rputs Userdata.new.req_body '; } + location /backtrace { mruby_content_handler build/nginx/html/backtrace.rb; } @@ -927,6 +928,14 @@ http { Nginx.rputs "false" end '; + } + + location /issue-200 { + mruby_content_handler_code 'Nginx.return 200'; + } + + location /issue-225 { + mruby_content_handler_code 'Nginx.rputs nil'; } } diff --git a/test/t/ngx_mruby.rb b/test/t/ngx_mruby.rb index 64beebb2..8ed97cad 100644 --- a/test/t/ngx_mruby.rb +++ b/test/t/ngx_mruby.rb @@ -612,6 +612,18 @@ def is_async_supported? t.assert_equal 204, res["code"] end +t.assert('ngx_mruby - allow empty response body issue 200', 'location /issue-200') do + res = HttpRequest.new.get base + '/issue-200' + t.assert_equal 200, res["code"] + t.assert_equal "", res["body"] +end + +t.assert('ngx_mruby - allow empty response body issue 225', 'location /issue-225') do + res = HttpRequest.new.get base + '/issue-225' + t.assert_equal 200, res["code"] + t.assert_equal "", res["body"] +end + if nginx_features.is_stream_supported? base1 = "http://127.0.0.1:12345"