1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2025-08-19 13:13:02 +02:00

Add "myip6" URL parameter to provide an IPv6 address in addition to an IPv4 one as "myip"

This commit is contained in:
cn
2016-12-07 14:16:57 +01:00
parent ae095c22b7
commit 4894015325
6 changed files with 71 additions and 22 deletions

View File

@@ -11,9 +11,9 @@ module Dyndnsd
return [200, {"Content-Type" => "text/plain"}, ["nohost"]] if state == :host_forbidden
return [200, {"Content-Type" => "text/plain"}, ["notfqdn"]] if state == :hostname_malformed
end
def response_for_changes(states, ip)
body = states.map { |state| "#{state} #{ip}" }.join("\n")
body = states.map { |state| "#{state} #{ip.is_a?(Array) ? ip.join(' ') : ip}" }.join("\n")
return [200, {"Content-Type" => "text/plain"}, [body]]
end
end