From 8e63de3e6a350fca4afa40177c80465d1f96d575 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 10 Jul 2024 18:54:05 +0900 Subject: [PATCH] Handle test_post(TestNetHTTP_v1_2): EOFError: end of file reached --- test/net/http/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index b9b289d..79ab5c5 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -311,7 +311,7 @@ def handle_post(path, headers, socket) charset = parse_content_type(headers['Content-Type'])[1] path = "#{scheme}://#{host}:#{port}#{path}" path = path.encode(charset) if charset - response = "HTTP/1.1 200 OK\r\nContent-Type: #{headers['Content-Type']}\r\nContent-Length: #{body.bytesize}\r\nX-request-uri: #{path}\r\n\r\n#{body}" + response = "HTTP/1.1 200 OK\r\nContent-Type: #{headers['Content-Type']}\r\nContent-Length: #{headers['Content-Length']}\r\nX-request-uri: #{path}\r\n\r\n#{body}" socket.print(response) end