couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [2/2] git commit: Expose raw_path in req to show, list and externals.
Date Sun, 30 Oct 2011 21:05:31 GMT
Expose raw_path in req to show, list and externals.

Closes COUCHDB-676
Closes COUCHDB-341


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

Branch: refs/heads/master
Commit: ee8044ff5fe75dbd2f802ab50834af45a04299c9
Parents: 2000208
Author: Jan Lehnardt <jan@apache.org>
Authored: Sun Oct 30 22:03:42 2011 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Sun Oct 30 22:03:42 2011 +0100

----------------------------------------------------------------------
 share/www/script/test/list_views.js  |    2 ++
 src/couchdb/couch_httpd_external.erl |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ee8044ff/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 6449bd7..4cd9edf 100644
--- a/share/www/script/test/list_views.js
+++ b/share/www/script/test/list_views.js
@@ -252,6 +252,8 @@ couchTests.list_views = function(debug) {
   T(resp.req.headers.Host);
   T(resp.req.headers["User-Agent"]);
   T(resp.req.cookie);
+  TEquals("/test_suite_db/_design/lists/_list/basicJSON/basicView?update_seq=true",
+    resp.req.raw_path, "should include raw path");
 
   // get with query params
   xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView?startkey=3&endkey=8");

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ee8044ff/src/couchdb/couch_httpd_external.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_external.erl b/src/couchdb/couch_httpd_external.erl
index c199b4a..bfe77a3 100644
--- a/src/couchdb/couch_httpd_external.erl
+++ b/src/couchdb/couch_httpd_external.erl
@@ -87,6 +87,7 @@ json_req_obj(#httpd{mochi_req=Req,
         {<<"method">>, Method},
         {<<"requested_path">>, RequestedPath},
         {<<"path">>, Path},
+        {<<"raw_path">>, ?l2b(Req:get(raw_path))},
         {<<"query">>, json_query_keys(to_json_terms(Req:parse_qs()))},
         {<<"headers">>, to_json_terms(Hlist)},
         {<<"body">>, Body},


Mime
View raw message