summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/www/script/couch_tests.js1
-rw-r--r--src/couchdb/couch_httpd.erl13
2 files changed, 11 insertions, 3 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index b94f809e..8ceff3e3 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -491,7 +491,6 @@ var tests = {
restartServer();
T(db.open(designDoc._id) == null);
T(db.view("test/no_docs") == null);
-
},
view_collation: function(debug) {
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 26bb0915..ea614519 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -92,16 +92,18 @@ handle_request0(Req, DocumentRoot, Method, Path) ->
handle_welcome_request(Req, Method);
"/_all_dbs" ->
handle_all_dbs_request(Req, Method);
- "/favicon.ico" ->
- {ok, Req:serve_file("favicon.ico", DocumentRoot)};
"/_replicate" ->
handle_replicate_request(Req, Method);
+ "/_restart" ->
+ handle_restart_request(Req, Method);
"/_utils" ->
{ok, Req:respond({301, [{"Location", "/_utils/"}], <<>>})};
"/_utils/" ++ PathInfo ->
{ok, Req:serve_file(PathInfo, DocumentRoot)};
"/_" ++ _Path ->
throw({not_found, unknown_private_path});
+ "/favicon.ico" ->
+ {ok, Req:serve_file("favicon.ico", DocumentRoot)};
_Else ->
handle_db_request(Req, Method, {Path})
end.
@@ -135,6 +137,13 @@ handle_replicate_request(Req, 'POST') ->
handle_replicate_request(_Req, _Method) ->
throw({method_not_allowed, "POST"}).
+handle_restart_request(Req, 'POST') ->
+ couch_server:remote_restart(),
+ send_json(Req, {obj, [{ok, true}]});
+
+handle_restart_request(_Req, _Method) ->
+ throw({method_not_allowed, "POST"}).
+
% Database request handlers
handle_db_request(Req, Method, {Path}) ->