From 610064aea6eb707fe3b6a68f7c93005ceac0a2ec Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 9 Mar 2009 19:52:54 +0000 Subject: merge design doc resource branch. breaking changes to _view query paths. closes COUCHDB-280 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@751813 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_view.erl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/couchdb/couch_httpd_view.erl') diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index 6b9befe1..322cf945 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -49,13 +49,15 @@ design_doc_view(Req, Db, Id, ViewName, Keys) -> couch_stats_collector:increment({httpd, view_reads}), Result. -handle_view_req(#httpd{method='GET',path_parts=[_,_, Id, ViewName]}=Req, Db) -> - design_doc_view(Req, Db, Id, ViewName, nil); +handle_view_req(#httpd{method='GET', + path_parts=[_Db, _Design, DName, _View, ViewName]}=Req, Db) -> + design_doc_view(Req, Db, DName, ViewName, nil); -handle_view_req(#httpd{method='POST',path_parts=[_,_, Id, ViewName]}=Req, Db) -> +handle_view_req(#httpd{method='POST', + path_parts=[_Db, _Design, DName, _View, ViewName]}=Req, Db) -> {Props} = couch_httpd:json_body(Req), Keys = proplists:get_value(<<"keys">>, Props, nil), - design_doc_view(Req, Db, Id, ViewName, Keys); + design_doc_view(Req, Db, DName, ViewName, Keys); handle_view_req(Req, _Db) -> send_method_not_allowed(Req, "GET,POST,HEAD"). -- cgit v1.2.3