Skip to content

Commit

Permalink
Handle test_post(TestNetHTTP_v1_2): EOFError: end of file reached
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jul 10, 2024
1 parent 205bac7 commit 8e63de3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/net/http/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8e63de3

Please sign in to comment.