Get rid of using Socket.gethostbyname

This commit is contained in:
Nobuyoshi Nakada 2020-08-31 17:23:54 +09:00
parent 3e1aea4613
commit 0eec4ae851
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -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