summaryrefslogtreecommitdiff
path: root/lib/webrick
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-08-31 17:23:54 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-08-31 17:45:27 +0900
commit0eec4ae85179fb6c8abd17d27b946d86f177f027 (patch)
tree20f864502902b12e7a7f8b87a2f675e69d6dd181 /lib/webrick
parent3e1aea461320094e634ab32ca0b13dd43b69d8b0 (diff)
Get rid of using Socket.gethostbyname
Diffstat (limited to 'lib/webrick')
-rw-r--r--lib/webrick/utils.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
index 07044876b9..a96d6f03fd 100644
--- a/lib/webrick/utils.rb
+++ b/lib/webrick/utils.rb
@@ -45,12 +45,7 @@ module WEBrick
##
# The server hostname
def getservername
- host = Socket::gethostname
- begin
- Socket::gethostbyname(host)[0]
- rescue
- host
- end
+ Socket::gethostname
end
module_function :getservername