Repository: couchdb-chttpd Updated Branches: refs/heads/master f087a016e -> 32e965353
Accept OPTIONS requests to list functions COUCHDB-2850 Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/32e96535 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/32e96535 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/32e96535 Branch: refs/heads/master Commit: 32e9653530f8f347cd4947f6da8f2efc35824083 Parents: f087a01 Author: Alexander Shorin <[email protected]> Authored: Thu Oct 29 03:06:45 2015 +0300 Committer: Alexander Shorin <[email protected]> Committed: Thu Oct 29 17:26:54 2015 +0300 ---------------------------------------------------------------------- src/chttpd_show.erl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/32e96535/src/chttpd_show.erl ---------------------------------------------------------------------- diff --git a/src/chttpd_show.erl b/src/chttpd_show.erl index 924221a..d049756 100644 --- a/src/chttpd_show.erl +++ b/src/chttpd_show.erl @@ -153,18 +153,21 @@ send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId) -> % view-list request with view and list from same design doc. -handle_view_list_req(#httpd{method='GET', - path_parts=[_, _, DesignName, _, ListName, ViewName]}=Req, Db, DDoc) -> +handle_view_list_req(#httpd{method=Method, + path_parts=[_, _, DesignName, _, ListName, ViewName]}=Req, Db, DDoc) + when Method =:= 'GET' orelse Method =:= 'OPTIONS' -> Keys = chttpd:qs_json_value(Req, "keys", undefined), handle_view_list(Req, Db, DDoc, ListName, {DesignName, ViewName}, Keys); % view-list request with view and list from different design docs. -handle_view_list_req(#httpd{method='GET', - path_parts=[_, _, _, _, ListName, DesignName, ViewName]}=Req, Db, DDoc) -> +handle_view_list_req(#httpd{method=Method, + path_parts=[_, _, _, _, ListName, DesignName, ViewName]}=Req, Db, DDoc) + when Method =:= 'GET' orelse Method =:= 'OPTIONS' -> Keys = chttpd:qs_json_value(Req, "keys", undefined), handle_view_list(Req, Db, DDoc, ListName, {DesignName, ViewName}, Keys); -handle_view_list_req(#httpd{method='GET'}=Req, _Db, _DDoc) -> +handle_view_list_req(#httpd{method=Method}=Req, _Db, _DDoc) + when Method =:= 'GET' orelse Method =:= 'OPTIONS' -> chttpd:send_error(Req, 404, <<"list_error">>, <<"Invalid path.">>); handle_view_list_req(#httpd{method='POST',
