Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

test_httpresponse.rb test failures

Abierto
#112 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
ruby

Línea de trabajo

Comienza con test/webrick/test_httpresponse.rb, especialmente con las seis pruebas fallidas de response splitting y sus llamadas a refute_match; después, inspecciona lib/webrick/httpresponse.rb alrededor de la línea 260 indicada. Ejecuta la suite de pruebas con Ruby 2.7.4 y determina qué cambio hace que las pruebas pasen sin la advertencia indicada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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!

Lenguaje dominante
Ruby
Estrellas
327
Forks
113
Merge medio
4 h 2 min
PR fusionados (30 d)
1

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ruby/webrick

Todos los issues de ruby/webrick

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.