Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/webrick/test_httpproxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def test_proxy

req = Net::HTTP::Post.new("/")
req.body = "post-data"
req.content_type = "application/x-www-form-urlencoded"
http.request(req){|res|
assert_equal("1.1 localhost.localdomain:#{port}", res["via"], log.call)
assert_equal("POST / post-data", res.body, log.call)
Expand Down Expand Up @@ -108,6 +109,7 @@ def test_no_proxy
assert_equal(2, request_handler_called, log.call)

req = Net::HTTP::Post.new("/")
req.content_type = "application/x-www-form-urlencoded"
req.body = "post-data"
http.request(req){|res|
assert_nil(res["via"], log.call)
Expand Down Expand Up @@ -241,6 +243,7 @@ def test_upstream_proxy

req = Net::HTTP::Post.new("/")
req.body = "post-data"
req.content_type = "application/x-www-form-urlencoded"
http.request(req){|res|
via = res["via"].split(/,\s+/)
assert(via.include?("1.1 localhost.localdomain:#{up_port}"), up_log.call + log.call)
Expand Down Expand Up @@ -285,6 +288,7 @@ def test_upstream_proxy

req2 = Net::HTTP::Post.new("/")
req2.body = "post-data"
req2.content_type = "application/x-www-form-urlencoded"
http.request(req2){|res|
assert_equal("SSL POST / post-data", res.body, up_log.call + log.call + s_log.call)
}
Expand Down