summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_show.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-03-09 19:52:54 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-03-09 19:52:54 +0000
commit610064aea6eb707fe3b6a68f7c93005ceac0a2ec (patch)
tree432a31e5c0561e10f9b1e4973c2741c5c777c1f1 /src/couchdb/couch_httpd_show.erl
parentdd79e85bc9e4849df904498ca25ec56304440b5f (diff)
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
Diffstat (limited to 'src/couchdb/couch_httpd_show.erl')
-rw-r--r--src/couchdb/couch_httpd_show.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl
index 5a03d9de..7b6f2832 100644
--- a/src/couchdb/couch_httpd_show.erl
+++ b/src/couchdb/couch_httpd_show.erl
@@ -24,7 +24,7 @@
handle_doc_show_req(#httpd{
method='GET',
- path_parts=[_, _, DesignName, ShowName, DocId]
+ path_parts=[_DbName, _Design, DesignName, _Show, ShowName, DocId]
}=Req, Db) ->
DesignId = <<"_design/", DesignName/binary>>,
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, [], []),
@@ -39,7 +39,7 @@ handle_doc_show_req(#httpd{
handle_doc_show_req(#httpd{
method='GET',
- path_parts=[_, _, DesignName, ShowName]
+ path_parts=[_DbName, _Design, DesignName, _Show, ShowName]
}=Req, Db) ->
DesignId = <<"_design/", DesignName/binary>>,
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, [], []),
@@ -53,7 +53,8 @@ handle_doc_show_req(#httpd{method='GET'}=Req, _Db) ->
handle_doc_show_req(Req, _Db) ->
send_method_not_allowed(Req, "GET,HEAD").
-handle_view_list_req(#httpd{method='GET',path_parts=[_, _, DesignName, ListName, ViewName]}=Req, Db) ->
+handle_view_list_req(#httpd{method='GET',
+ path_parts=[_DbName, _Design, DesignName, _List, ListName, ViewName]}=Req, Db) ->
DesignId = <<"_design/", DesignName/binary>>,
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, [], []),
Lang = proplists:get_value(<<"language">>, Props, <<"javascript">>),
@@ -63,7 +64,8 @@ handle_view_list_req(#httpd{method='GET',path_parts=[_, _, DesignName, ListName,
handle_view_list_req(#httpd{method='GET'}=Req, _Db) ->
send_error(Req, 404, <<"list_error">>, <<"Invalid path.">>);
-handle_view_list_req(#httpd{method='POST',path_parts=[_, _, DesignName, ListName, ViewName]}=Req, Db) ->
+handle_view_list_req(#httpd{method='POST',
+ path_parts=[_DbName, _Design, DesignName, _List, ListName, ViewName]}=Req, Db) ->
DesignId = <<"_design/", DesignName/binary>>,
#doc{body={Props}} = couch_httpd_db:couch_doc_open(Db, DesignId, [], []),
Lang = proplists:get_value(<<"language">>, Props, <<"javascript">>),