[ 
https://issues.apache.org/jira/browse/COUCHDB-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15185550#comment-15185550
 ] 

ASF GitHub Bot commented on COUCHDB-2748:
-----------------------------------------

GitHub user robertkowalski opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/662

    Revert "JS validation added for Add Database"

    This reverts commit b8bbb87c6919469521ff277694fb75e898157a7c.
    
    The commit was added in https://github.com/apache/couchdb-fauxton/pull/468
    but the validation has to happen in the backend. The current
    validation does not cover databases which are created via curl or
    other apps. It also prevents users from creating an accidentally
    deleted `_users` database.
    
    The fix for the root cause has to happen in the backend.
    
    We should avoid trying to add validations in multiple, different
    places.
    
    COUCHDB-2748

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robertkowalski/couchdb-fauxton 
2748-ids-validation-users-db

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/662.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #662
    
----
commit c8d959591bbca1f718ea2335a95cdfb5bf0bdaec
Author: Robert Kowalski <[email protected]>
Date:   2016-03-08T19:12:04Z

    Revert "JS validation added for Add Database"
    
    This reverts commit b8bbb87c6919469521ff277694fb75e898157a7c.
    
    The commit was added in https://github.com/apache/couchdb-fauxton/pull/468
    but the validation has to happen in the backend. The current
    validation does not cover databases which are created via curl or
    other apps. It also prevents users from creating an accidentally
    deleted `_users` database.
    
    The fix for the root cause has to happen in the backend.
    
    We should avoid trying to add validations in multiple, different
    places.
    
    COUCHDB-2748

----


> encoding problems with reserved chars
> -------------------------------------
>
>                 Key: COUCHDB-2748
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2748
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>            Reporter: Robert Kowalski
>
> Let's create a database!
> {noformat}
> curl -X PUT http://localhost:5984/testrainyday
> {noformat}
> I get:  {{{"ok":true}}}
> Let's create a document called BANANA%253A21%25
> {noformat}
> curl -X PUT http://localhost:5984/testrainyday/BANANA%253A21%25 -d '{}'
> {noformat}
> CouchDB returns:
> {noformat}
> {"_id":"BANANA%3A21%","_rev":"1-967a00dff5e02add41819138abb3284d"}
> {noformat}
> (note the changed id - it misses the 25)
> lets use the id from the response to retrieve the doc:
> {noformat}
> curl http://localhost:5984/testrainyday/BANANA%3A21%
> {noformat}
> i get:
> {noformat}
> {"error":"not_found","reason":"missing"}
> {noformat}
> :(
> New try:
> curl http://localhost:5984/testrainyday/_all_docs
> returns:
> {noformat}
> {"total_rows":1,"offset":0,"rows":[
> {"id":"BANANA%3A21%","key":"BANANA%3A21%","value":{"rev":"1-967a00dff5e02add41819138abb3284d"}}
> ]}
> {noformat}
> I get BANANA%3A21% as id again, but when I want to curl it or use in my JS 
> application, I get `{"error":"not_found","reason":"missing"}`
> I noticed that it works for these two ids:
> curl -X PUT http://localhost:5984/testrainyday/BANANA%25 -d '{}'
> {noformat}
> {"ok":true,"id":"BANANA%","rev":"1-967a00dff5e02add41819138abb3284d"}
> {noformat}
> In this last case it works magically for both ids:
> {noformat}
> (17:54:11) [robert@tequila-work] ~ $ curl -X PUT 
> http://localhost:5984/testrainyday/BANANA%25 -d '{}'
> {"ok":true,"id":"BANANA%","rev":"1-967a00dff5e02add41819138abb3284d"}
> (17:55:45) [robert@tequila-work] ~ $ curl 
> http://localhost:5984/testrainyday/BANANA%25
> {"_id":"BANANA%","_rev":"1-967a00dff5e02add41819138abb3284d"}
> (17:55:57) [robert@tequila-work] ~ $ curl 
> http://localhost:5984/testrainyday/BANANA%
> {"_id":"BANANA%","_rev":"1-967a00dff5e02add41819138abb3284d"}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to