[
https://issues.apache.org/jira/browse/COUCHDB-3031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15319006#comment-15319006
]
ASF GitHub Bot commented on COUCHDB-3031:
-----------------------------------------
GitHub user eiri opened a pull request:
https://github.com/apache/couchdb-couch-mrview/pull/47
Don't try to decode non-stringified JSON in params
It is possible for the params "key", "keys", "startkey" and "endkey" to
receive already decoded JSON array, if the query was done with `POST` and
"keys" or "queries" payload.
COUCHDB-3031
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloudant/couchdb-couch-mrview
67171-dont-decode-json-in-params
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-couch-mrview/pull/47.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 #47
----
commit 3a1cb4494b8a68187ea290779261cca07784bd81
Author: Eric Avdey <[email protected]>
Date: 2016-06-07T17:47:32Z
Don't try to decode non stringified JSON in params
It is possible for the params "key", "keys", "startkey" and "endkey"
to receive already decoded JSON array, if the query was done with POST
and "keys" or "queries" payload.
----
> 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)