Skip to content

Commit

Permalink
Fix warning about missing content type.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 27, 2023
1 parent 841b7da commit 9501735
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/webrick/test_httpserver.rb
Expand Up @@ -541,21 +541,25 @@ def test_big_chunks
end

def test_accept_put_requests
TestWEBrick.start_httpserver {|server, addr, port, log|
TestWEBrick.start_httpserver do |server, addr, port, log|
server.mount_proc("/", lambda {|req, res|
res.status = 200
assert_equal("abcde", req.body)
})

Thread.pass while server.status != :Running

Net::HTTP.start(addr, port) do |http|
req = Net::HTTP::Put.new("/")
req.body = "abcde"
http.request(req){|res|
req['content-type'] = "text/plain"

http.request(req) do |res|
assert_equal("200", res.code)
}
end

server.shutdown
end
}
end
end
end

0 comments on commit 9501735

Please sign in to comment.