summaryrefslogtreecommitdiff
path: root/lib/nickserver
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nickserver')
-rw-r--r--lib/nickserver/couch_db/response.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/nickserver/couch_db/response.rb b/lib/nickserver/couch_db/response.rb
index c6afe03..fe482a8 100644
--- a/lib/nickserver/couch_db/response.rb
+++ b/lib/nickserver/couch_db/response.rb
@@ -17,7 +17,11 @@ module Nickserver::CouchDB
end
def content
- key_response if ok? && !empty?
+ if ok? && !empty?
+ key_response
+ else
+ not_found_response
+ end
end
protected
@@ -26,6 +30,10 @@ module Nickserver::CouchDB
format address: nick.to_s, openpgp: key
end
+ def not_found_response
+ format({})
+ end
+
def format(response)
response.to_json
end