You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Will Holley (JIRA)" <ji...@apache.org> on 2015/11/23 15:02:11 UTC
[jira] [Commented] (COUCHDB-2765) CouchDB sends 200 and invalid
JSON if _changes view filter is invalid
[ https://issues.apache.org/jira/browse/COUCHDB-2765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15022120#comment-15022120 ]
Will Holley commented on COUCHDB-2765:
--------------------------------------
CouchDB 2.X rejects design docs containing invalid views, avoiding the scenario illustrated in the test case.
> CouchDB sends 200 and invalid JSON if _changes view filter is invalid
> ----------------------------------------------------------------------
>
> Key: COUCHDB-2765
> URL: https://issues.apache.org/jira/browse/COUCHDB-2765
> Project: CouchDB
> Issue Type: Bug
> Components: HTTP Interface
> Reporter: Nolan Lawson
>
> If you provide a {{view}} with {{filter=_view}} in {{_changes}} and the referenced {{view}} is a design doc with no {{map}} function, then the database returns a 200 with invalid JSON.
> cURL to reproduce:
> {code}
> curl 'http://127.0.0.1:5984/testdb/' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'
> curl 'http://127.0.0.1:5984/testdb/' -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json'
> curl 'http://127.0.0.1:5984/testdb/_design/name' -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '{"_id":"_design/name","views":{"name":{"empty":"sad face"}}}'
> curl 'http://127.0.0.1:5984/testdb/_changes?timeout=25000&feed=longpoll&filter=_view&view=name%2Fname&since=0&limit=25&_nonce=1438464395669' -H 'Accept: application/json'
> {code}
> Result:
> {code}
> {"ok":true}
> {"ok":true}
> {"ok":true,"id":"_design/name","rev":"1-214291b1f3879ad7a5f408d3e1edb53b"}
> {"results":[
> curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding
> {code}
> The final response from CouchDB is this invalid JSON:
> {code}
> {"results":[
> An error has occurred: {"bytesParsed":0,"code":"HPE_INVALID_CHUNK_SIZE"}
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)