Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit f6b5608dd05db1f10faaa6b426659dfcb84e22e4 1 parent 0193f62
@cmlenz cmlenz authored
Showing with 7 additions and 0 deletions.
  1. +1 −0  THANKS
  2. +6 −0 src/couchdb/couch_httpd.erl
View
1  THANKS
@@ -9,6 +9,7 @@ changes. A list of these people is included below.
* Chris Anderson <jchris@grabb.it>
* William Beh <willbeh@gmail.com>
* Benoit Chesneau <bchesneau@gmail.com>
+ * Paul Joseph Davis <paul.joseph.davis@gmail.com>
* Till Klampaeckel <till@klampaeckel.de>
* Roger Leigh <rleigh@debian.org>
* Jim Lindley <web@jimlindley.com>
View
6 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);
Please sign in to comment.
Something went wrong with that request. Please try again.