summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-06-04 10:41:46 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-06-04 10:41:46 +0000
commitf6b5608dd05db1f10faaa6b426659dfcb84e22e4 (patch)
tree9341189f8b75fdb63d07420025b43e781f73447d /src
parent0193f6280ce311c86e097ed38ad5802d3dcf7734 (diff)
Enable the use of an unencoded slash in the URL of design documents. Closes COUCHDB-49. Thanks to Paul Davis for the patch.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@663055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 27bc385c..d22ea2b1 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -432,6 +432,12 @@ handle_db_request(_Req, _Method, {_DbName, _Db, ["_temp_view"]}) ->
% Document request handlers
+handle_db_request(Req, Method, {DbName, Db, ["_design", DesignName]}) ->
+ % Special case to enable using an unencoded in the URL of design docs, as
+ % slashes in document IDs must otherwise be URL encoded
+ DocId = mochiweb_util:join(["_design", DesignName], "/"),
+ handle_db_request(Req, Method, {DbName, Db, [DocId]});
+
handle_db_request(Req, Method, {DbName, Db, [DocId]}) ->
UnquotedDocId = mochiweb_util:unquote(DocId),
handle_doc_request(Req, Method, DbName, Db, UnquotedDocId);