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

Benoit Chesneau commented on COUCHDB-998:
-----------------------------------------

After looking at the code, the patch seems right since the viewName is directly 
saved in storage from the url and get from url parts:

var urlParts = location.search.substr(1).split("/");

var viewName = (urlParts.length > 0) ? urlParts.join("/") : null;
      if (viewName) {
        $.futon.storage.set("view", viewName);
      } else {
        viewName = $.futon.storage.get("view");
        if (viewName) {
          this.redirecting = true;
          location.href = "database.html?" + encodeURIComponent(dbName) +
            "/" + encodeURIComponent(viewName);
        }
      }

So it shouldn't be encoded after that imo.



> aggressive use of encodeURIComponent on view names inside Futon
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-998
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-998
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Futon
>    Affects Versions: 1.0, 1.0.1, 1.0.2, 1.1, 1.2, 2.0
>            Reporter: Gordon Stratton
>            Priority: Minor
>             Fix For: 1.0.2, 1.1, 1.2, 2.0
>
>         Attachments: futon.browse.js.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> Steps to reproduce:
> 1. Enter a database containing a design document view
> 2. Select one of the design document views from the view list dropdown
> 3. Navigate back to the Overview section
> 4. Navigate back to the database you were just in
> As you can tell by looking at the Location bar, the view name has had 
> encodeURIComponent applied to it, and so the view won't be found by CouchDB. 
> I'm going to attach a patch that fixes the issue for me, but it needs review 
> in case the fix needs to happen in some other place inside Futon. I'm judging 
> this patch based on the way the view switching works in the view list 
> dropdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to