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

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

GitHub user eiri opened a pull request:

    https://github.com/apache/couchdb-chttpd/pull/127

    Don't try to decode params in multi_query_view

    Parameters in `multi_query_view` got decoded before parsing as part of 
reading POST's json body. This makes `parse_params` to skip double parsing and 
allows to use complex view keys in multi query payload.
    
    COUCHDB-3031

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

    $ git pull https://github.com/cloudant/couchdb-chttpd 
67171-dont-decode-params-in-multiview

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

    https://github.com/apache/couchdb-chttpd/pull/127.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 #127
    
----
commit 685f9ca7b1a37d5bcf5ea71cfc099e6110be9f96
Author: Eric Avdey <[email protected]>
Date:   2016-06-13T16:53:55Z

    Don't try to decode params in multi_query_view

----


> Multi-query for views with the complex keys throws 400
> ------------------------------------------------------
>
>                 Key: COUCHDB-3031
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3031
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: Eric Avdey
>
> For the views with complex keys (e.g. array) the multi-query request ( 
> {{POST}} on {{/db/_design/ddoc/_view/view}} with payload like {noformat} 
> {'queries': [{'startkey': ['a', 'et '], 'endkey': ['blanditiis', 
> 'voluptatem']}, ... } {noformat}  returns {noformat} 
> {"error":"bad_request","reason":"invalid UTF-8 JSON"} {noformat}
> When startkey and endkeys are presented as stringified JSON the request is 
> coming through, but multi_query_view/5 throws the following exception
> {code}
> [error] req_err(515264238) badrecord : vacc
>     [<<"chttpd_view:multi_query_view/5 L37">>,
>      <<"chttpd:process_request/1 L293">>,
>      <<"chttpd:handle_request_int/1 L229">>,
>      <<"mochiweb_http:headers/6 L122">>,<<"proc_lib:init_p_do_apply/3 L240">>]
> {code}



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

Reply via email to