Token-handler now uses HTTP headers to know the true origin IP address.
parent
76244e6fe7
commit
611765d45d
|
@ -13,13 +13,8 @@ dnsmanagerd = DNSManager::Client.new
|
||||||
#dnsmanagerd.login login, pass
|
#dnsmanagerd.login login, pass
|
||||||
|
|
||||||
server = HTTP::Server.new do |context|
|
server = HTTP::Server.new do |context|
|
||||||
pp! context.request.remote_address
|
pp! context.request.headers["Host"]
|
||||||
ip = case remote = context.request.remote_address
|
ip = context.request.headers["Host"] rescue next
|
||||||
when Socket::IPAddress
|
|
||||||
remote.address
|
|
||||||
else
|
|
||||||
""
|
|
||||||
end
|
|
||||||
|
|
||||||
case context.request.path
|
case context.request.path
|
||||||
when /^\/token-update\/(?<token>[a-z0-9-]+)/
|
when /^\/token-update\/(?<token>[a-z0-9-]+)/
|
||||||
|
|
Loading…
Reference in New Issue