You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/08/27 15:38:10 UTC

[GitHub] [couchdb] sztanyoo opened a new issue #2148: Required content-type header is not enforced when putting attachments

sztanyoo opened a new issue #2148: Required content-type header is not enforced when putting attachments
URL: https://github.com/apache/couchdb/issues/2148
 
 
   ## Description
   
   According to https://docs.couchdb.org/en/stable/api/document/attachments.html#put--db-docid-attname Content-Type is a required header in case of adding new attachment.
   However, attachments can be created without specifying the content type
   
   ## Steps to Reproduce
   ```
   curl -v -X PUT  http://xxx:yyy@localhost:5984/database/25/asdf.jpg?rev=5-6c8c656d493947cd111370956d87745e --upload-file ~/Documents/asdf.jpg
   *   Trying ::1...
   * TCP_NODELAY set
   * Connected to localhost (::1) port 5984 (#0)
   * Server auth using Basic with user 'xxx'
   > PUT /database/25/asdf.jpg?rev=5-6c8c656d493947cd111370956d87745e HTTP/1.1
   > Host: localhost:5984
   > Authorization: Basic xxxxxx
   > User-Agent: curl/7.54.0
   > Accept: */*
   > Content-Length: 94733
   > Expect: 100-continue
   >
   < HTTP/1.1 100 Continue
   < Connection: close
   < Date: Tue, 27 Aug 2019 13:26:18 GMT
   < Server: MochiWeb/1.0 (Any of you quaids got a smint?)
   * We are completely uploaded and fine
   < HTTP/1.1 201 Created
   < Cache-Control: must-revalidate
   < Content-Length: 65
   < Content-Type: application/json
   < Date: Tue, 27 Aug 2019 13:26:18 GMT
   < Location: http://localhost:5984/database/25/asdf.jpg
   < Server: CouchDB/2.3.1 (Erlang OTP/19)
   < X-Couch-Request-ID: ba2950c6cf
   < X-CouchDB-Body-Time: 0
   <
   {"ok":true,"id":"25","rev":"6-5e71a7080f3661108237954db783c0bf"}
   ```
   ## Expected Behaviour
   
   When required header is not provided 400 Bad Request should be provided.
   
   ## Your Environment
   
   {"couchdb":"Welcome","version":"2.3.1","git_sha":"c298091a4","uuid":"8f9306c0bae0dddec670160224ec140e","features":["pluggable-storage-engines","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
   
   CouchDB Version used: 2.3.1
   Browser name and version: curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
   Operating System and version: mac OS Mojave 10.14.6

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services