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

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

GitHub user willholley opened a pull request:

    https://github.com/apache/couchdb/pull/237

    Fauxton: fix fauxton query parameters for complex keys (COUCHDB-2249)

    Fix URL generation in Fauxton when complex keys are specified as query 
parameters (COUCHDB-2249). 
    
    This PR contains two changes:
    
    1. Documents.QueryParams.parse no longer modifies it's input in-place.
    2. urlParams returned by createParams contains the stringified parameters 
(rather than the parsed representation that it was returning previously).

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

    $ git pull https://github.com/willholley/couchdb 
2249-fix-fauxton-url-generation-complex-keys

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

    https://github.com/apache/couchdb/pull/237.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 #237
    
----
commit b56fa66b9664e5b468ded0788dc3ae9f8051aa7d
Author: Will Holley <willhol...@gmail.com>
Date:   2014-05-27T04:50:36Z

    Fauxton: do not modify query options in-place
    
    Ensure we clone the parameters to Documents.QueryParams.parse and
    Documents.QueryParams.stringify. These functions should return new data
    structures rather than modifying the input in-place.

commit cca4a009f88656f0fdb6d4e9b1f173a2262853eb
Author: Will Holley <willhol...@gmail.com>
Date:   2014-05-27T04:57:47Z

    Fauxton: urlParams should be stringified
    
    Do not use the parsed query object for url generation. Instead, use the
    stringified representation. Fixes COUCHDB-2249.

----


> Fauxton generates incorrect parameters when complex keys are specified
> ----------------------------------------------------------------------
>
>                 Key: COUCHDB-2249
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2249
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Fauxton
>            Reporter: Will Holley
>
> Fauxton is not stringifying user-defined query parameters correctly (added in 
> the "Query Options" panel). This results in a query parameter being generated 
> for each component of the complex key.
> For example, specifying a startkey of {noformat}["a","b"]{noformat} generates 
> the URL 
> {noformat}
> ?startkey[]=a&startkey[]=b
> {noformat}
> instead of:
> {noformat}
> ?startkey=["a","b"]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to