couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [3/3] git commit: Allow OPTIONS HTTP method for list requests.
Date Sat, 29 Oct 2011 18:59:52 GMT
Allow OPTIONS HTTP method for list requests.

Closes COUCHDB-1097

Patch by Omar Yasin.


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

Branch: refs/heads/master
Commit: 9f53704af06c8eeffb0b47a526a3777bb33c737a
Parents: 3b37d17
Author: Jan Lehnardt <jan@apache.org>
Authored: Sat Oct 29 20:53:29 2011 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Sat Oct 29 20:53:29 2011 +0200

----------------------------------------------------------------------
 THANKS                                     |    1 +
 share/www/script/test/list_views.js        |    4 ++++
 src/couch_mrview/src/couch_mrview_show.erl |    3 ++-
 3 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9f53704a/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index 320d744..714c224 100644
--- a/THANKS
+++ b/THANKS
@@ -90,5 +90,6 @@ suggesting improvements or submitting changes. Some of these people are:
  * Christopher Bonhage <queezey@me.com>
  * Christian Carter <cdcarter@gmail.com>
  * Lukasz Mielicki <mielicki@gmail.com>
+ * Omar Yasin <omarkj@gmail.com>
 
 For a list of authors see the `AUTHORS` file.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9f53704a/share/www/script/test/list_views.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js
index c8af481..6449bd7 100644
--- a/share/www/script/test/list_views.js
+++ b/share/www/script/test/list_views.js
@@ -204,6 +204,10 @@ couchTests.list_views = function(debug) {
   T(xhr.status == 200, "standard get should be 200");
   T(/head0123456789tail/.test(xhr.responseText));
 
+  // standard options
+  var xhr = CouchDB.request("OPTIONS", "/test_suite_db/_design/lists/_list/basicBasic/basicView");
+  T(xhr.status == 200, "standard get should be 200");
+  T(/head0123456789tail/.test(xhr.responseText));
 
   // test that etags are available
   var etag = xhr.getResponseHeader("etag");

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9f53704a/src/couch_mrview/src/couch_mrview_show.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/src/couch_mrview_show.erl b/src/couch_mrview/src/couch_mrview_show.erl
index c77abac..5a7ce5f 100644
--- a/src/couch_mrview/src/couch_mrview_show.erl
+++ b/src/couch_mrview/src/couch_mrview_show.erl
@@ -154,7 +154,8 @@ send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId) ->
     couch_httpd_external:send_external_response(Req, JsonResp).
 
 
-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' ->
     case Req#httpd.path_parts of
         [_, _, _DName, _, LName, VName] ->
             % Same design doc for view and list


Mime
View raw message