GitHub user nickva opened a pull request:
https://github.com/apache/couchdb-couch-mrview/pull/29
Validate incompatible query parameters: group and group_level
Jira: COUCH-2824
Parameters group and group_level currently were
overriding each other -- last one in the list "won".
Those parameters are not compatible with each other,
instead return a 400 result to the user with an
appropriate error message.
Example of new behavior:
```
$ http "$DB1/db1/_design/des1/_view/v1?group_level=1&group=true"
HTTP/1.1 400 Bad Request
{"error":"query_parse_error","reason":"`group` and `group_level` are
incompatible"}
```
Also added unit test module for mrview parameter parsing. Ran with :
```
export BUILDIR=`pwd` && rebar -r eunit apps=couch_mrview
tests="mrview_http_params_group_true_test,mrview_http_params_group_false_test,mrview_http_params_group_level_test,mrview_http_params_group_and_group_level_incompatibl_test"
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nickva/couchdb-couch-mrview
2824-group-view-params
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-couch-mrview/pull/29.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 #29
----
commit 28e1a9ad504f734deda85bde87e2fe2882ff7d24
Author: Nick Vatamaniuc <[email protected]>
Date: 2015-09-22T21:55:00Z
Validate incompatible query parameters: group and group_level
Jira: COUCH-2824
Parameters group and group_level currently were
overriding each other -- last one in the list "won".
Those parameters are not compatible with each other,
instead return a 400 result to the user with an
appropriate error message.
Example of new behavior:
```
$ http "$DB1/db1/_design/des1/_view/v1?group_level=1&group=true"
HTTP/1.1 400 Bad Request
{"error":"query_parse_error","reason":"`group` and `group_level` are
incompatible"}
```
Also added unit test module for mrview parameter parsing. Ran with :
```
export BUILDIR=`pwd` && rebar -r eunit apps=couch_mrview
tests="mrview_http_params_group_true_test,mrview_http_params_group_false_test,mrview_http_params_group_level_test,mrview_http_params_group_and_group_level_incompatibl_test"
```
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---