You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/03/19 20:07:30 UTC

[GitHub] dubee closed pull request #163: validate that query_params is valid JSON

dubee closed pull request #163: validate that query_params is valid JSON
URL: https://github.com/apache/incubator-openwhisk-package-cloudant/pull/163
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/actions/changesWebAction.js b/actions/changesWebAction.js
index 3f02994..73b24ac 100644
--- a/actions/changesWebAction.js
+++ b/actions/changesWebAction.js
@@ -48,6 +48,9 @@ function main(params) {
                 catch (e) {
                     return sendError(400, 'The query_params parameter cannot be parsed. Ensure it is valid JSON.');
                 }
+                if (typeof query_params !== 'object') {
+                    return sendError(400, 'The query_params parameter is not valid JSON');
+                }
             }
         }
         else if (params.query_params) {
@@ -169,6 +172,9 @@ function main(params) {
                                 catch (e) {
                                     reject(sendError(400, 'The query_params parameter cannot be parsed. Ensure it is valid JSON.'));
                                 }
+                                if (typeof updatedParams.query_params !== 'object') {
+                                    reject(sendError(400, 'The query_params parameter is not valid JSON'));
+                                }
                             }
                         } else {
                             reject(sendError(400, 'The query_params parameter is only allowed if the filter parameter is defined'));


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services