couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject git commit: Fix attachment name validation when creating inline attachments.
Date Sat, 29 Oct 2011 15:57:41 GMT
Updated Branches:
  refs/heads/1.1.x af7a6ae52 -> a3bb784e8


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/a3bb784e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a3bb784e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a3bb784e

Branch: refs/heads/1.1.x
Commit: a3bb784e8be86e57287c2d52d4514f9b18247380
Parents: af7a6ae
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:32 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/a3bb784e/src/couchdb/couch_httpd_db.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 0bf97e2..59eeb98 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -219,6 +219,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, []}};


Mime
View raw message