Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

test_httpresponse.rb test failures

Đang mở
#112 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
backend, testing-qa

Hướng nghiên cứu

Bắt đầu với test/webrick/test_httpresponse.rb, đặc biệt là sáu bài kiểm thử response splitting đang thất bại và các lệnh gọi refute_match của chúng, sau đó kiểm tra lib/webrick/httpresponse.rb quanh dòng 260 được báo cáo. Chạy bộ kiểm thử với Ruby 2.7.4 và xác định thay đổi nào khiến các bài kiểm thử vượt qua mà không có cảnh báo được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi,

Testing the latest release (1.8.1) with Ruby 2.7.4, I see the following test failures:

F
==========================================================================================================
     71:       io.rewind
     72:       res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io))
     73:       assert_equal '500', res.code
  => 74:       refute_match 'cracked_indicator_for_test', io.string
     75:     end
     76: 
     77:     def test_prevent_response_splitting_headers_lf
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/test/webrick/test_httpresponse.rb:74:in `test_prevent_response_splitting_cookie_headers_cr'
Failure: test_prevent_response_splitting_cookie_headers_cr(WEBrick::TestHTTPResponse):
  <REGEXP> in assert_not_match(<REGEXP>, ...) should be a Regexp.
  <"cracked_indicator_for_test"> was expected to be instance_of?
  <Regexp> but was
  <String>.
==========================================================================================================
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
F
==========================================================================================================
     50:       io.rewind
     51:       res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io))
     52:       assert_equal '500', res.code
  => 53:       refute_match 'cracked_indicator_for_test', io.string
     54:     end
     55: 
     56:     def test_prevent_response_splitting_headers_cr
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/test/webrick/test_httpresponse.rb:53:in `test_prevent_response_splitting_cookie_headers_crlf'
Failure: test_prevent_response_splitting_cookie_headers_crlf(WEBrick::TestHTTPResponse):
  <REGEXP> in assert_not_match(<REGEXP>, ...) should be a Regexp.
  <"cracked_indicator_for_test"> was expected to be instance_of?
  <Regexp> but was
  <String>.
==========================================================================================================
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
F
==========================================================================================================
     92:       io.rewind
     93:       res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io))
     94:       assert_equal '500', res.code
  => 95:       refute_match 'cracked_indicator_for_test', io.string
     96:     end
     97: 
     98:     def test_set_redirect_response_splitting
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/test/webrick/test_httpresponse.rb:95:in `test_prevent_response_splitting_cookie_headers_lf'
Failure: test_prevent_response_splitting_cookie_headers_lf(WEBrick::TestHTTPResponse):
  <REGEXP> in assert_not_match(<REGEXP>, ...) should be a Regexp.
  <"cracked_indicator_for_test"> was expected to be instance_of?
  <Regexp> but was
  <String>.
==========================================================================================================
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
F
==========================================================================================================
     60:       io.rewind
     61:       res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io))
     62:       assert_equal '500', res.code
  => 63:       refute_match 'cracked_indicator_for_test', io.string
     64:     end
     65: 
     66:     def test_prevent_response_splitting_cookie_headers_cr
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/test/webrick/test_httpresponse.rb:63:in `test_prevent_response_splitting_headers_cr'
Failure: test_prevent_response_splitting_headers_cr(WEBrick::TestHTTPResponse):
  <REGEXP> in assert_not_match(<REGEXP>, ...) should be a Regexp.
  <"cracked_indicator_for_test"> was expected to be instance_of?
  <Regexp> but was
  <String>.
==========================================================================================================
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
F
==========================================================================================================
     39:       io.rewind
     40:       res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io))
     41:       assert_equal '500', res.code
  => 42:       refute_match 'cracked_indicator_for_test', io.string
     43:     end
     44: 
     45:     def test_prevent_response_splitting_cookie_headers_crlf
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/test/webrick/test_httpresponse.rb:42:in `test_prevent_response_splitting_headers_crlf'
Failure: test_prevent_response_splitting_headers_crlf(WEBrick::TestHTTPResponse):
  <REGEXP> in assert_not_match(<REGEXP>, ...) should be a Regexp.
  <"cracked_indicator_for_test"> was expected to be instance_of?
  <Regexp> but was
  <String>.
==========================================================================================================
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
F
==========================================================================================================
     81:       io.rewind
     82:       res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io))
     83:       assert_equal '500', res.code
  => 84:       refute_match 'cracked_indicator_for_test', io.string
     85:     end
     86: 
     87:     def test_prevent_response_splitting_cookie_headers_lf
/tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/test/webrick/test_httpresponse.rb:84:in `test_prevent_response_splitting_headers_lf'
Failure: test_prevent_response_splitting_headers_lf(WEBrick::TestHTTPResponse):
  <REGEXP> in assert_not_match(<REGEXP>, ...) should be a Regexp.
  <"cracked_indicator_for_test"> was expected to be instance_of?
  <Regexp> but was
  <String>.
==========================================================================================================
...../tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
......./tmp/guix-build-ruby-webrick-1.8.1.drv-1/source/lib/webrick/httpresponse.rb:260: warning: instance variable @upgrade not initialized
..
Finished in 7.279902005 seconds.
----------------------------------------------------------------------------------------------------------
138 tests, 790 assertions, 6 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
95.6522% passed
----------------------------------------------------------------------------------------------------------
18.96 tests/s, 108.52 assertions/s
rake aborted!
Command failed with status (1)

Any idea what they could be caused by?

Thanks!

Ngôn ngữ chính
Ruby
Star
327
Fork
113
Merge trung bình
4 giờ 2 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ruby/webrick

Tất cả issue của ruby/webrick

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.