Skip to content

Commit

Permalink
Fix attachment name validation when creating inline attachments.
Browse files Browse the repository at this point in the history
Do not allow names to start with an underscore.

Closes COUCHDB-1210.
  • Loading branch information
janl committed Oct 29, 2011
1 parent bea76db commit 0585879
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/couchdb/couch_httpd_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,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, []}};
Expand Down

0 comments on commit 0585879

Please sign in to comment.