From c098a92f057fe59b384692b23e8a7b0e83314f62 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 10 Jul 2024 17:36:59 +0900 Subject: [PATCH] Handle test failure with test_post(TestNetHTTP_v1_2) --- test/net/http/utils.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index b9b289d..038b1e7 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -313,6 +313,9 @@ def handle_post(path, headers, socket) 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}" socket.print(response) + rescue EOFError + response = "HTTP/1.1 400 Bad Request\r\nContent-Type: text/plain\r\nContent-Length: 0\r\n\r\n" + socket.print(response) end def handle_patch(path, headers, socket)