Skip to content

Commit

Permalink
Use assert_raise instead of assert_raises
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Oct 20, 2023
1 parent 289581e commit c957968
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/webrick/test_httpresponse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ def test_prevent_response_splitting_cookie_headers_lf

def test_set_redirect_response_splitting
url = "malicious\r\nCookie: cracked_indicator_for_test"
assert_raises(URI::InvalidURIError) do
assert_raise(URI::InvalidURIError) do
res.set_redirect(WEBrick::HTTPStatus::MultipleChoices, url)
end
end

def test_set_redirect_html_injection
url = 'http://example.com////?a</a><head></head><body><img src=1></body>'
assert_raises(WEBrick::HTTPStatus::MultipleChoices) do
assert_raise(WEBrick::HTTPStatus::MultipleChoices) do
res.set_redirect(WEBrick::HTTPStatus::MultipleChoices, url)
end
res.status = 300
Expand Down

0 comments on commit c957968

Please sign in to comment.