Skip to content

Commit 205bac7

Browse files
committed
Write log after server start, not handling request
1 parent 749a1b3 commit 205bac7

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
@@ -265,6 +265,7 @@ def spawn_server
265265
@log_tester = lambda {|log| assert_equal([], log) }
266266
@config = self.class::CONFIG
267267
@server = HTTPServer.new(@config) do |method, path, headers, socket|
268+
@log << "DEBUG accept: #{@config['host']}:#{socket.addr[1]}" if @logger_level == :debug
268269
case method
269270
when 'HEAD'
270271
handle_head(path, headers, socket)
@@ -277,7 +278,6 @@ def spawn_server
277278
else
278279
socket.print "HTTP/1.1 405 Method Not Allowed\r\nContent-Length: 0\r\n\r\n"
279280
end
280-
@log << "DEBUG accept: #{@config['host']}:#{socket.addr[1]}" if @logger_level == :debug
281281
end
282282
@server.start
283283
@config['port'] = @server.port

0 commit comments

Comments
 (0)