You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2015/06/02 21:30:58 UTC

[08/41] chttpd commit: updated refs/heads/2080-port-cors to e2c2bd7

Rename argument to reflect new semantic


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/0525f3e4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/0525f3e4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/0525f3e4

Branch: refs/heads/2080-port-cors
Commit: 0525f3e472e083bd0660a10aa9b0ccd00f33197d
Parents: 896484e
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Fri Dec 19 08:48:05 2014 -0800
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Fri Dec 19 08:48:05 2014 -0800

----------------------------------------------------------------------
 src/chttpd_db.erl | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/0525f3e4/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index b1dd452..105553f 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -418,28 +418,28 @@ db_req(#httpd{method='POST',path_parts=[_,<<"_purge">>]}=Req, Db) ->
 db_req(#httpd{path_parts=[_,<<"_purge">>]}=Req, _Db) ->
     send_method_not_allowed(Req, "POST");
 
-db_req(#httpd{method='GET',path_parts=[_,NS]}=Req, Db) when ?IS_ALL_DOCS(NS) ->
+db_req(#httpd{method='GET',path_parts=[_,OP]}=Req, Db) when ?IS_ALL_DOCS(OP) ->
     case chttpd:qs_json_value(Req, "keys", nil) of
     Keys when is_list(Keys) ->
-        all_docs_view(Req, Db, Keys, NS);
+        all_docs_view(Req, Db, Keys, OP);
     nil ->
-        all_docs_view(Req, Db, undefined, NS);
+        all_docs_view(Req, Db, undefined, OP);
     _ ->
         throw({bad_request, "`keys` parameter must be an array."})
     end;
 
-db_req(#httpd{method='POST',path_parts=[_,NS]}=Req, Db) when ?IS_ALL_DOCS(NS) ->
+db_req(#httpd{method='POST',path_parts=[_,OP]}=Req, Db) when ?IS_ALL_DOCS(OP) ->
     {Fields} = chttpd:json_body_obj(Req),
     case couch_util:get_value(<<"keys">>, Fields, nil) of
     Keys when is_list(Keys) ->
-        all_docs_view(Req, Db, Keys, NS);
+        all_docs_view(Req, Db, Keys, OP);
     nil ->
-        all_docs_view(Req, Db, undefined, NS);
+        all_docs_view(Req, Db, undefined, OP);
     _ ->
         throw({bad_request, "`keys` body member must be an array."})
     end;
 
-db_req(#httpd{path_parts=[_,NS]}=Req, _Db) when ?IS_ALL_DOCS(NS) ->
+db_req(#httpd{path_parts=[_,OP]}=Req, _Db) when ?IS_ALL_DOCS(OP) ->
     send_method_not_allowed(Req, "GET,HEAD,POST");
 
 db_req(#httpd{method='POST',path_parts=[_,<<"_missing_revs">>]}=Req, Db) ->
@@ -537,9 +537,9 @@ db_req(#httpd{path_parts=[_, DocId]}=Req, Db) ->
 db_req(#httpd{path_parts=[_, DocId | FileNameParts]}=Req, Db) ->
     db_attachment_req(Req, Db, DocId, FileNameParts).
 
-all_docs_view(Req, Db, Keys, NS) ->
+all_docs_view(Req, Db, Keys, OP) ->
     Args0 = couch_mrview_http:parse_params(Req, Keys),
-    Args1 = set_namespace(NS, Args0),
+    Args1 = set_namespace(OP, Args0),
     ETagFun = fun(Sig, Acc0) ->
         couch_mrview_http:check_view_etag(Sig, Acc0, Req)
     end,