From 52d0dc95166dbbcd293afb3bfca6ca8533c00270 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Mon, 26 May 2008 09:20:47 +0000 Subject: Change error handling on unknown private paths to be more consistent with how other errors are handled. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@660139 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd.erl | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 2324171e..5ee7f6ab 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -99,8 +99,8 @@ handle_request0(Req, DocumentRoot, Method, Path) -> {ok, Req:respond({301, [{"Location", "/_utils/"}], <<>>})}; "/_utils/" ++ PathInfo -> {ok, Req:serve_file(PathInfo, DocumentRoot)}; - "/_" ++ UnknownPrivatePath -> - handle_unkown_private_uri_request(Req, Method, UnknownPrivatePath); + "/_" ++ _Path -> + throw({not_found, unknown_private_path}); _Else -> handle_db_request(Req, Method, {Path}) end. @@ -134,18 +134,6 @@ handle_replicate_request(Req, 'POST') -> handle_replicate_request(_Req, _Method) -> throw({method_not_allowed, "POST"}). -handle_unkown_private_uri_request(Req, _Method, UnknownPrivatePath) -> - KnownPrivatePaths = ["_utils"], - Msg = {obj, - [ - {error, "Could not find the private path '_" ++ - mochiweb_util:unquote(UnknownPrivatePath) ++ - "'. Known private path(s): '" ++ - lists:flatten(KnownPrivatePaths) ++ "'"} - ] - }, - send_error(Req, 404, Msg). - % Database request handlers handle_db_request(Req, Method, {Path}) -> -- cgit v1.2.3