diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-02-13 18:33:16 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-02-13 18:33:16 +0000 |
commit | eb81ff32d07cb8cbe1a13a495a2aabd968313821 (patch) | |
tree | 191539e4bc0bc62e6221b6c11a6368a8309f9a4b /src/couchdb/couch_httpd_view.erl | |
parent | 9b2e6ed37184709e70def81d53246a9fe58f18ba (diff) |
Apply COUCHDB-251.
Allow _list functions to accept arbitrary GET parameters.
Thanks Paul Davis.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@744210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r-- | src/couchdb/couch_httpd_view.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index 7666da98..7696bb0d 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -15,7 +15,7 @@ -export([handle_view_req/2,handle_temp_view_req/2]). --export([parse_view_query/1,parse_view_query/2,make_view_fold_fun/5, +-export([parse_view_query/1,parse_view_query/2,parse_view_query/4,make_view_fold_fun/5, finish_view_fold/3, view_row_obj/3]). -import(couch_httpd, @@ -210,6 +210,8 @@ parse_view_query(Req) -> parse_view_query(Req, Keys) -> parse_view_query(Req, Keys, nil). parse_view_query(Req, Keys, IsReduce) -> + parse_view_query(Req, Keys, IsReduce, false). +parse_view_query(Req, Keys, IsReduce, IgnoreExtra) -> QueryList = couch_httpd:qs(Req), #view_query_args{ group_level = GroupLevel @@ -332,9 +334,14 @@ parse_view_query(Req, Keys, IsReduce) -> % we just ignore format, so that JS can have it Args; _ -> % unknown key - Msg = lists:flatten(io_lib:format( - "Bad URL query key:~s", [Key])), - throw({query_parse_error, Msg}) + case IgnoreExtra of + true -> + Args; + false -> + Msg = lists:flatten(io_lib:format( + "Bad URL query key:~s", [Key])), + throw({query_parse_error, Msg}) + end end end, #view_query_args{}, QueryList), case IsReduce of |