Skip to content

Commit

Permalink
Add failing test for HTTP 1.0 connections
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonrayhamilton committed Aug 15, 2020
1 parent 6c25f81 commit 5ba56b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/proxy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,12 @@ def test_lowercase_header
assert_equal "HTTP/1.1 200 OK\r\n", socket.gets # a lowercase request header is tolerated
end
end

def test_close_http_1_0_connection_with_body
TCPSocket.open("localhost", 20557) do |socket|
socket.write("GET / HTTP/1.0\r\nHost: example.localhost\r\n\r\n")
# Response body should be present (https://github.com/ysbaddaden/prax.cr/issues/77):
assert_equal "HTTP/1.0 200 OK\r\n\r\nexample", socket.gets
end
end
end

0 comments on commit 5ba56b9

Please sign in to comment.