You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2010/02/03 19:55:31 UTC
svn commit: r906172 - /couchdb/trunk/src/couchdb/couch_httpd_db.erl
Author: benoitc
Date: Wed Feb 3 18:55:30 2010
New Revision: 906172
URL: http://svn.apache.org/viewvc?rev=906172&view=rev
Log:
fix #COUCHDB-595 thanks for tests and report.
Modified:
couchdb/trunk/src/couchdb/couch_httpd_db.erl
Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=906172&r1=906171&r2=906172&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Wed Feb 3 18:55:30 2010
@@ -1048,7 +1048,7 @@
end;
-db_attachment_req(#httpd{method=Method}=Req, Db, DocId, FileNameParts)
+db_attachment_req(#httpd{method=Method,mochi_req=MochiReq}=Req, Db, DocId, FileNameParts)
when (Method == 'PUT') or (Method == 'DELETE') ->
FileName = validate_attachment_name(
mochiweb_util:join(
@@ -1082,6 +1082,20 @@
0 ->
<<"">>;
Length when is_integer(Length) ->
+ Expect = case couch_httpd:header_value(Req, "expect") of
+ undefined ->
+ undefined;
+ Value when is_list(Value) ->
+ string:to_lower(Value)
+ end,
+ case Expect of
+ "100-continue" ->
+ MochiReq:start_raw_response({100, gb_trees:empty()});
+ _Else ->
+ ok
+ end,
+
+
fun() -> couch_httpd:recv(Req, 0) end;
Length ->
exit({length_not_integer, Length})