mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-07-21 21:11:17 +02:00
Add "myip6" URL parameter to provide an IPv6 address in addition to an IPv4 one as "myip"
This commit is contained in:
@ -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
|
||||
|
@ -11,9 +11,9 @@ module Dyndnsd
|
||||
return [403, {"Content-Type" => "text/plain"}, ["Forbidden"]] if state == :host_forbidden
|
||||
return [422, {"Content-Type" => "text/plain"}, ["Hostname malformed"]] if state == :hostname_malformed
|
||||
end
|
||||
|
||||
|
||||
def response_for_changes(states, ip)
|
||||
body = states.map { |state| state == :good ? "Changed to #{ip}" : "No change needed for #{ip}" }.join("\n")
|
||||
body = states.map { |state| state == :good ? "Changed to #{ip.is_a?(Array) ? ip.join(' ') : ip}" : "No change needed for #{ip.is_a?(Array) ? ip.join(' ') : ip}" }.join("\n")
|
||||
return [200, {"Content-Type" => "text/plain"}, [body]]
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user