Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log binding on http:// for TCP bindings to make it clickable #2167

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -10,6 +10,7 @@
* Changed #connected_port to #connected_ports (#2076)
* `--control` has been removed. Use `--control-url` (#1487)
* `worker_directory` has been removed. Use `directory`
* Log binding on http:// for TCP bindings to make it clickable

* Bugfixes
* Windows update extconf.rb for use with ssp and varied Ruby/MSYS2 combinations (#2069)
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/binder.rb
Expand Up @@ -115,7 +115,7 @@ def parse(binds, logger, log_msg = 'Listening')
i.local_address.ip_unpack.join(':')
end

logger.log "* #{log_msg} on tcp://#{addr}"
logger.log "* #{log_msg} on http://#{addr}"
end
end

Expand Down
8 changes: 4 additions & 4 deletions test/test_binder.rb
Expand Up @@ -64,7 +64,7 @@ def test_home_alters_listeners_for_ssl_addresses
def test_correct_zero_port
@binder.parse ["tcp://localhost:0"], @events

m = %r!tcp://127.0.0.1:(\d+)!.match(@events.stdout.string)
m = %r!http://127.0.0.1:(\d+)!.match(@events.stdout.string)
port = m[1].to_i

refute_equal 0, port
Expand All @@ -84,9 +84,9 @@ def test_correct_zero_port_ssl
def test_logs_all_localhost_bindings
@binder.parse ["tcp://localhost:0"], @events

assert_match %r!tcp://127.0.0.1:(\d+)!, @events.stdout.string
assert_match %r!http://127.0.0.1:(\d+)!, @events.stdout.string
if Socket.ip_address_list.any? {|i| i.ipv6_loopback? }
assert_match %r!tcp://\[::1\]:(\d+)!, @events.stdout.string
assert_match %r!http://\[::1\]:(\d+)!, @events.stdout.string
end
end

Expand Down Expand Up @@ -271,7 +271,7 @@ def assert_parsing_logs_uri(order = [:unix, :tcp])

prepared_paths = {
ssl: "ssl://127.0.0.1:#{UniquePort.call}?#{ssl_query}",
tcp: "tcp://127.0.0.1:#{UniquePort.call}",
tcp: "http://127.0.0.1:#{UniquePort.call}",
unix: "unix://test/#{name}_server.sock"
}

Expand Down