Skip to content
Snippets Groups Projects
Unverified Commit 8e4dca14 authored by azul's avatar azul
Browse files

bugfix: send empty json object on 404 rather than nil

sending nothing was keeping the connection alive.
parent afdfd541
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -17,7 +17,11 @@ module Nickserver::CouchDB ...@@ -17,7 +17,11 @@ module Nickserver::CouchDB
end end
def content def content
key_response if ok? && !empty? if ok? && !empty?
key_response
else
not_found_response
end
end end
protected protected
...@@ -26,6 +30,10 @@ module Nickserver::CouchDB ...@@ -26,6 +30,10 @@ module Nickserver::CouchDB
format address: nick.to_s, openpgp: key format address: nick.to_s, openpgp: key
end end
def not_found_response
format({})
end
def format(response) def format(response)
response.to_json response.to_json
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment