Updated Branches:
refs/heads/1.0.x 74044749d -> 9c377a1af
Fix attachment name validation when creating inline attachments.
Do not allow names to start with an underscore.
Closes COUCHDB-1210.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9c377a1a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9c377a1a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9c377a1a
Branch: refs/heads/1.0.x
Commit: 9c377a1afe16e35945a8d8969a475e005fb5033e
Parents: 7404474
Author: Jan Lehnardt <jan@apache.org>
Authored: Sat Oct 29 17:54:49 2011 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Sat Oct 29 17:57:46 2011 +0200
----------------------------------------------------------------------
src/couchdb/couch_httpd_db.erl | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9c377a1a/src/couchdb/couch_httpd_db.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 2d0156b..37eda52 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -214,6 +214,7 @@ db_req(#httpd{method='GET',path_parts=[_DbName]}=Req, Db) ->
db_req(#httpd{method='POST',path_parts=[DbName]}=Req, Db) ->
couch_httpd:validate_ctype(Req, "application/json"),
Doc = couch_doc:from_json_obj(couch_httpd:json_body(Req)),
+ validate_attachment_names(Doc),
Doc2 = case Doc#doc.id of
<<"">> ->
Doc#doc{id=couch_uuids:new(), revs={0, []}};
|