lib/openname.rb in openname-0.4.6 vs lib/openname.rb in openname-0.4.7
- old
+ new
@@ -75,10 +75,17 @@
when "200" then
json_body = JSON.parse(res.body)
if(json_body["status"] && json_body["status"] == "reserved")
NameError.new("Openname \"#{openname}\" does not exist. It is reserved.")
else
- json_body
+ # Current ONS resolver wraps profile
+ # so as to also return proof verification
+ # results. openname-ruby ignores verifications
+ if (json_body["profile"])
+ json_body["profile"]
+ else
+ json_body
+ end
end
else
error = JSON.parse(res.body)
raise RuntimeError.new("Openname endpoint returned error: #{error["error"]}")
end