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/04/02 10:49:47 UTC

[GitHub] [couchdb] jjrodrig opened a new pull request #1997: Fix apache/couchdb#1988 - Validate attachment names at POST /db/doc and GET /db/doc/attachment

jjrodrig opened a new pull request #1997: Fix apache/couchdb#1988 - Validate attachment names at POST /db/doc and GET /db/doc/attachment
URL: https://github.com/apache/couchdb/pull/1997
 
 
   <!-- Thank you for your contribution!
   
        Please file this form by replacing the Markdown comments
        with your text. If a section needs no action - remove it.
   
        Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
        of code collaboration. Positive feedback is represented +1 from committers
        and negative is a -1. The -1 also means veto, and needs to be addressed
        to proceed. Once there are no objections, the PR can be merged by a
        CouchDB committer.
   
        See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->
   
   ## Overview
    This PR solves the problem described at he issue #1988 
   
   PUT & POST operations for creating documents in a database enforce different validation rules over the attachment names of the new document.
   
   When a document is created with a PUT operation "_foo.txt" is not accepted as a valid attachment name. If the document is created by a POST operation the "_foo.txt" attachment name is accepted.
   
   This is an inconsistent behavoiur in the API as not accepted attachment names can be created. 
   
   Another inconsinstency is found in the GET attachment opperation that does not enforce the same attachment name validation rule that the rest of attachment operations DELETE/PUT.
   
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   
   ## Testing recommendations
   
   Tests has been added into attachment_names.js test suite for testing attachment names during POST document creation and GET attachment retrieval. 
   
   ```
   make javascript suites="attachment_names"
   ```
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   
   ## Related Issues or Pull Requests
    This PR fixes #1988 
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  -->
   
   ## Checklist
   
   - [X] Code is written and works correctly;
   - [X] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   

----------------------------------------------------------------
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