Skip to content

Commit

Permalink
Handle test failure with test_post(TestNetHTTP_v1_2)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jul 10, 2024
1 parent 205bac7 commit abe902a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/net/http/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit abe902a

Please sign in to comment.