diff --git a/config.ru b/config.ru new file mode 100644 index 00000000..65ce25ff --- /dev/null +++ b/config.ru @@ -0,0 +1 @@ +run(proc{|env| [200, {}, [env['HTTP_FOO'].inspect, "\n"]]}) \ No newline at end of file diff --git a/test/test_http11.rb b/test/test_http11.rb index 2a300470..3725a639 100644 --- a/test/test_http11.rb +++ b/test/test_http11.rb @@ -2,6 +2,7 @@ # Copyright (c) 2005 Zed A. Shaw require_relative "helper" +require "digest" require "puma/puma_http11" @@ -181,6 +182,17 @@ class Http11ParserTest < Minitest::Test parser.reset end end + end + + # https://github.com/puma/puma/issues/1890 + def test_trims_whitespace_from_headers + skip("Known failure, see issue 1890 on GitHub") + parser = Puma::HttpParser.new + req = {} + http = "GET / HTTP/1.1\r\nX-Strip-Me: Strip This \r\n\r\n" + nread = parser.execute(req, http, 0) + + assert_equal "Strip This", req["HTTP_X_STRIP_ME"] end end