Commit 45577945 authored by Colin Shea's avatar Colin Shea

TXT handling: Yell about >255 characters

This can be fixed by splitting it up into multiple quoted strings
surrounded by parentheses, but I don't feel like adding that complexity
just yet.
parent c49cf6b1
...@@ -137,7 +137,8 @@ class Zone ...@@ -137,7 +137,8 @@ class Zone
ttl = extract_ttl! args ttl = extract_ttl! args
text = args.pop.to_s.strip text = args.pop.to_s.strip
name = args.pop || '@' name = args.pop || '@'
text = "\"#{text}\"" if text =~ /\s/ text = "\"#{text}\"" if text !~ /^".*"$/
raise ArgumentError, 'TXT record too long, max length is 255' if text.length > 257
push :txt, name, ttl, text: text push :txt, name, ttl, text: text
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment