Skip to content

Commit

Permalink
Add tests for matsumotory#200 and matsumotory#225
Browse files Browse the repository at this point in the history
  • Loading branch information
yyamano committed Aug 19, 2020
1 parent 249abc3 commit 457fbc4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ http {
Nginx.rputs Userdata.new.req_body
';
}

location /backtrace {
mruby_content_handler build/nginx/html/backtrace.rb;
}
Expand Down Expand Up @@ -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';
}

location /issue-471 {
Expand Down
12 changes: 12 additions & 0 deletions test/t/ngx_mruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,18 @@ def _run
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"
Expand Down

0 comments on commit 457fbc4

Please sign in to comment.