mooli tayer has posted comments on this change.

Change subject: rest-api: validation of max parameter in restapi
......................................................................


Patch Set 2: Verified+1

(1 comment)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendResource.java
Line 131:             HashMap<String,String> matrixConstraints = 
QueryHelper.getMatrixConstraints(getUriInfo(), MAX);
Line 132:             String maxString = matrixConstraints.get(MAX);
Line 133:             try {
Line 134:                 Integer max = Integer.valueOf(maxString);
Line 135:                 if (max < -1){
sorry, didn't catch this.

if some one wrote in a script 
list vms --limit 0
I don't want to fail him
(because failing and not ignoring the param is new functionality) I will create 
an sql query of "SELECT ... LIMIT 0" doesn't really make scene, but I don't 
want it to fail
Line 136:                     return failMaxResults(maxString);
Line 137:                 }
Line 138:                 return max;
Line 139:             } catch (NumberFormatException e) {


-- 
To view, visit http://gerrit.ovirt.org/18043
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae3397dba4dffbff2ecf7d7601861540b52aa9bb
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mta...@redhat.com>
Gerrit-Reviewer: Eli Mesika <elimes...@gmail.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: mooli tayer <mta...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to