Skip to content

Commit 8e63de3

Browse files
committed
Handle test_post(TestNetHTTP_v1_2): EOFError: end of file reached
1 parent 205bac7 commit 8e63de3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/net/http/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def handle_post(path, headers, socket)
311311
charset = parse_content_type(headers['Content-Type'])[1]
312312
path = "#{scheme}://#{host}:#{port}#{path}"
313313
path = path.encode(charset) if charset
314-
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}"
314+
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}"
315315
socket.print(response)
316316
end
317317

0 commit comments

Comments
 (0)