Get rid of using Socket.gethostbyname
This commit is contained in:
parent
3e1aea4613
commit
0eec4ae851
@ -45,12 +45,7 @@ module WEBrick
|
|||||||
##
|
##
|
||||||
# The server hostname
|
# The server hostname
|
||||||
def getservername
|
def getservername
|
||||||
host = Socket::gethostname
|
Socket::gethostname
|
||||||
begin
|
|
||||||
Socket::gethostbyname(host)[0]
|
|
||||||
rescue
|
|
||||||
host
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
module_function :getservername
|
module_function :getservername
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user