Skip to content

Commit

Permalink
Write log after server start, not handling request
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jul 10, 2024
1 parent 749a1b3 commit 205bac7
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 @@ -265,6 +265,7 @@ def spawn_server
@log_tester = lambda {|log| assert_equal([], log) }
@config = self.class::CONFIG
@server = HTTPServer.new(@config) do |method, path, headers, socket|
@log << "DEBUG accept: #{@config['host']}:#{socket.addr[1]}" if @logger_level == :debug
case method
when 'HEAD'
handle_head(path, headers, socket)
Expand All @@ -277,7 +278,6 @@ def spawn_server
else
socket.print "HTTP/1.1 405 Method Not Allowed\r\nContent-Length: 0\r\n\r\n"
end
@log << "DEBUG accept: #{@config['host']}:#{socket.addr[1]}" if @logger_level == :debug
end
@server.start
@config['port'] = @server.port
Expand Down

0 comments on commit 205bac7

Please sign in to comment.