Skip to content

Commit

Permalink
Merge pull request #265 from go-kivik/defaultCT-v3
Browse files Browse the repository at this point in the history
Don't require a ContentType for attachments
  • Loading branch information
flimzy authored Dec 2, 2020
2 parents 76772d6 + 4ab432a commit 487ff2f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ func (d *db) PutAttachment(ctx context.Context, docID, rev string, att *driver.A
if att.Filename == "" {
return "", missingArg("att.Filename")
}
if att.ContentType == "" {
return "", missingArg("att.ContentType")
}
if att.Content == nil {
return "", missingArg("att.Content")
}
Expand Down
10 changes: 0 additions & 10 deletions attachments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ func TestPutAttachment(t *testing.T) {
status: http.StatusBadRequest,
err: "kivik: att.Filename required",
},
{
name: "missing content type",
id: "foo",
rev: "1-xxx",
att: &driver.Attachment{
Filename: "x.jpg",
},
status: http.StatusBadRequest,
err: "kivik: att.ContentType required",
},
{
name: "no body",
id: "foo",
Expand Down

0 comments on commit 487ff2f

Please sign in to comment.