summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-05-26 09:20:47 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-05-26 09:20:47 +0000
commit52d0dc95166dbbcd293afb3bfca6ca8533c00270 (patch)
treec76fd6523f335ba2ac9e437dc3f39f02dbc0b50d /src
parent65e850a01858509e0bc519832686aa52d58809b0 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd.erl16
1 files changed, 2 insertions, 14 deletions
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}) ->