base64 dns key

This commit is contained in:
Kload 2013-07-07 11:00:21 +00:00
parent 8bc0ea6813
commit 9bbf3af4fa

View file

@ -73,7 +73,7 @@ end
if params.has_key?("public_key")
public_key = Base64.decode64(params[:public_key])
unless public_key.length == 24
halt 400, { :error => "Key is invalid: #{public_key}" }.to_json
halt 400, { :error => "Key is invalid: #{public_key.to_s.encode('UTF-8', {:invalid => :replace, :undef => :replace, :replace => '?'})}" }.to_json
end
end
if params.has_key?("subdomain")