mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Use Test::Unit instead of Minitest::Unit
This commit is contained in:
		
							parent
							
								
									0d343bf823
								
							
						
					
					
						commit
						8ab2afb20b
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1,11 +1,11 @@
 | 
			
		|||
# frozen_string_literal: false
 | 
			
		||||
require "webrick"
 | 
			
		||||
require "minitest/autorun"
 | 
			
		||||
require "test/unit"
 | 
			
		||||
require "stringio"
 | 
			
		||||
require "net/http"
 | 
			
		||||
 | 
			
		||||
module WEBrick
 | 
			
		||||
  class TestHTTPResponse < MiniTest::Unit::TestCase
 | 
			
		||||
  class TestHTTPResponse < Test::Unit::TestCase
 | 
			
		||||
    class FakeLogger
 | 
			
		||||
      attr_reader :messages
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -94,14 +94,14 @@ module WEBrick
 | 
			
		|||
 | 
			
		||||
    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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue