GitHub user michellephung opened a pull request:

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

    Take out one layer of encoding

    There is some encoding issues going on.  :/
    
    This is related to [original reason for the change: COUCHDB-2717] 
(https://issues.apache.org/jira/browse/COUCHDB-2717), and possibly related to 
[DBCore Issue:COUCHDB-2748 ](https://issues.apache.org/jira/browse/COUCHDB-2748)
    
    We're double encoding the url, in app/addons/documents/base.js, (file 
edited in this PR).
    
    I am able to save a document with the name:
    ![screen shot 2015-08-03 at 3 33 04 
pm](https://cloud.githubusercontent.com/assets/836039/9045938/59ffdd8a-39f5-11e5-8edb-bdd7cb8d2d85.png)
    but when I click on it: i am rerouted back to all docs, because: 
    GET http://localhost:8000/aaa/__hello-world%253A%2520colonspace__ 404 (Not 
Found)
    
    So it SHOULD go to:
    
    GET http://localhost:8000/aaa/__hello-world%3A%20colonspace__
    
    (notice the extra '25' before the %3A=(colon) and %20=(space), and that 
%25=(percent sign))
    
    Research
    - A bit of explaining as to what that `%2520` is :
    
    - The common space character is encoded as` %20` as you noted yourself. 
The` %` character is encoded as `%25`.
    
    - The way you get `%2520` is when your url already has a`%20` in it, and 
gets urlencoded again, which transforms the `%20` to `%2520`.
    
    [Source: 
SO](http://stackoverflow.com/questions/16084935/a-html-space-is-showing-as-2520-instead-of-20)
    
    I'm not sure about the < back button behavior with when editing/looking at 
a view document, and if we still need to encode the url for that fix.
    
    @garrensmith could you take a look at this? for  [COUCHDB-2717] 
(https://issues.apache.org/jira/browse/COUCHDB-2717) I couldn't reproduce, and 
i remember you mentioned you fixed the < back button navigation after this fix, 
so we might not need to encode here. 
    
    
    


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

    $ git pull https://github.com/michellephung/couchdb-fauxton Encoding-issue

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

    https://github.com/apache/couchdb-fauxton/pull/489.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 #489
    
----
commit 2616f9c63cea200d665e282970ebafae34786f14
Author: Michelle Phung <[email protected]>
Date:   2015-08-03T19:31:17Z

    Take out one layer of encoding

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to