summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorBenoit Chesneau <benoitc@apache.org>2010-02-03 18:55:30 +0000
committerBenoit Chesneau <benoitc@apache.org>2010-02-03 18:55:30 +0000
commit17632461e3ea7007594783c39a25055fa0ccdffe (patch)
treeafcc73862c294fc6aa6974dd759b776524f348c8 /src/couchdb
parent4ffdb2666447e78714f03b54d31ede6a01eb16d5 (diff)
fix #COUCHDB-595 thanks for tests and report.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906172 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_httpd_db.erl16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 78aa2d2a..4f2f1565 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -1048,7 +1048,7 @@ db_attachment_req(#httpd{method='GET'}=Req, Db, DocId, FileNameParts) ->
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 @@ db_attachment_req(#httpd{method=Method}=Req, Db, DocId, FileNameParts)
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})