Skip to content

Commit af613ee

Browse files
committed
Add a more readable #inspect
1 parent 5dfb3de commit af613ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/rex/proto/http/server.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ def initialize(port = 80, listen_host = '0.0.0.0', ssl = false, context = {}, co
113113
self.server_name = DefaultServer
114114
end
115115

116+
# More readable inspect that only shows the url and resources
117+
# @return [String]
118+
def inspect
119+
resources_str = resources.keys.map{|r| r.inspect }.join ", "
120+
121+
"#<#{self.class} http#{ssl ? "s" : ""}://#{listen_host}:#{listen_port} [ #{resources_str} ]>"
122+
end
123+
116124
#
117125
# Returns the hardcore alias for the HTTP service
118126
#

0 commit comments

Comments
 (0)