You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2015/12/12 15:15:03 UTC

[1/2] chttpd commit: updated refs/heads/1.x-compat to 5d08f62

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/1.x-compat [created] 5d08f62f8


1.x compat: parse form data for externals on PUT in addtion ot POST


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

Branch: refs/heads/1.x-compat
Commit: 6421adc5c200781f95b7bfdb66718bff35cb423c
Parents: a57e869
Author: Jan Lehnardt <ja...@apache.org>
Authored: Sat Dec 12 15:09:01 2015 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Sat Dec 12 15:09:01 2015 +0100

----------------------------------------------------------------------
 src/chttpd_external.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/6421adc5/src/chttpd_external.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_external.erl b/src/chttpd_external.erl
index 6986a04..9df120f 100644
--- a/src/chttpd_external.erl
+++ b/src/chttpd_external.erl
@@ -69,7 +69,7 @@ json_req_obj(#httpd{mochi_req=Req,
         Else -> Else
     end,
     ParsedForm = case Req:get_primary_header_value("content-type") of
-        "application/x-www-form-urlencoded" ++ _ when Method =:= 'POST' ->
+        "application/x-www-form-urlencoded" ++ _ when Method =:= 'POST' orelse Method =:= 'PUT' ->
             mochiweb_util:parse_qs(Body);
         _ ->
             []


[2/2] chttpd commit: updated refs/heads/1.x-compat to 5d08f62

Posted by ja...@apache.org.
1.x compat: update fun: allow docs with slash in id


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

Branch: refs/heads/1.x-compat
Commit: 5d08f62f8aa3e858c2c707ade2b96a26d90e900c
Parents: 6421adc
Author: Jan Lehnardt <ja...@apache.org>
Authored: Sat Dec 12 15:14:37 2015 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Sat Dec 12 15:14:37 2015 +0100

----------------------------------------------------------------------
 src/chttpd_show.erl | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/5d08f62f/src/chttpd_show.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_show.erl b/src/chttpd_show.erl
index d049756..787df16 100644
--- a/src/chttpd_show.erl
+++ b/src/chttpd_show.erl
@@ -99,15 +99,16 @@ show_etag(#httpd{user_ctx=UserCtx}=Req, Doc, DDoc, More) ->
 %     send_method_not_allowed(Req, "POST,PUT,DELETE,ETC");
 
 handle_doc_update_req(#httpd{
-        path_parts=[_, _, _, _, UpdateName, DocId]
+        path_parts=[_, _, _, _, UpdateName]
     }=Req, Db, DDoc) ->
-    Doc = maybe_open_doc(Db, DocId),
-    send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId);
+    send_doc_update_response(Req, Db, DDoc, UpdateName, nil, null);
 
 handle_doc_update_req(#httpd{
-        path_parts=[_, _, _, _, UpdateName]
+        path_parts=[_, _, _, _, UpdateName | DocIdParts]
     }=Req, Db, DDoc) ->
-    send_doc_update_response(Req, Db, DDoc, UpdateName, nil, null);
+    DocId = ?l2b(string:join([?b2l(P) || P <- DocIdParts], "/")),
+    Doc = maybe_open_doc(Db, DocId),
+    send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId);
 
 handle_doc_update_req(Req, _Db, _DDoc) ->
     chttpd:send_error(Req, 404, <<"update_error">>, <<"Invalid path.">>).