summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 86e41f8b..85fbe868 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -168,6 +168,16 @@ handle_db_request(Req, 'PUT', {DbName, []}) ->
throw({unknown_error, Msg})
end;
+handle_db_request(Req, 'DELETE', {DbName, []}) ->
+ case couch_server:delete(DbName) of
+ ok ->
+ send_json(Req, 200, {obj, [
+ {ok, true}
+ ]});
+ Error ->
+ throw(Error)
+ end;
+
handle_db_request(Req, Method, {DbName, Rest}) ->
case couch_db:open(DbName, []) of
{ok, Db} ->
@@ -180,12 +190,6 @@ handle_db_request(Req, Method, {DbName, Rest}) ->
throw(Error)
end;
-handle_db_request(Req, 'DELETE', {DbName, _Db, []}) ->
- ok = couch_server:delete(DbName),
- send_json(Req, 200, {obj, [
- {ok, true}
- ]});
-
handle_db_request(Req, 'GET', {DbName, Db, []}) ->
{ok, DbInfo} = couch_db:get_db_info(Db),
send_json(Req, {obj, [{db_name, DbName} | DbInfo]});