tmm1 / http_parser.rb

simple callback-based HTTP request/response parser
MIT License
200 stars 43 forks source link

JRuby: Revert unimplemented "status" support and fix an failed test #73

Closed ashie closed 3 years ago

ashie commented 3 years ago

5 tests are fixed by #63 but still following 4 tests are failed:

Failures:

  1) HTTP::Parser should optionally reset parser state on no-body responses
     Failure/Error: expect(@complete).to eq(1)

       expected: 1
            got: 0

       (compared using ==)
     # ./spec/parser_spec.rb:198:in `block in <main>'

  2) HTTP::Parser should ignore extra content beyond specified length
     Failure/Error: @parser <<

     HTTP::Parser::Error:
       Connection already closed
     # org/ruby_http_parser/RubyHttpParser.java:379:in `<<'
     # ./spec/parser_spec.rb:301:in `block in <main>'

  3) HTTP::Parser should parse request: line folding in header value
     Failure/Error: expect(@headers).to eq(test['headers'])

       expected: {"Line1"=>"abc\tdef ghi\t\tjkl mno \t \tqrs", "Line2"=>"line2\t"}
            got: {"Line1"=>"abcdefghijklmno qrs", "Line2"=>"line2\t"}

       (compared using ==)

       Diff:
       @@ -1 +1 @@
       -"Line1" => "abc\tdef ghi\t\tjkl mno \t \tqrs",
       +"Line1" => "abcdefghijklmno qrs",

     # ./spec/parser_spec.rb:394:in `block in <main>'

  4) HTTP::Parser should parse request: utf-8 path request
     Failure/Error: expect(@parser.send("request_url")).to eq(test["request_url"].force_encoding(Encoding::BINARY))

       expected: "/\xCE\xB4\xC2\xB6/\xCE\xB4t/pope?q=1#narf"
            got: "/δ¶/δt/pope?q=1#narf"

       (compared using ==)
     # ./spec/parser_spec.rb:387:in `block in <main>'
ashie commented 3 years ago

Although there are still 3 failed tests, I'll merge this branch to master. I'll continue to check remaining failed tests in another pull request.

ashie commented 3 years ago

I'll continue to check remaining failed tests in another pull request.

75