Posting to the /quota or /share endpoints with a resource value that's negative or zero doesn't result in the correct behavior.
#1: Negative values are silently ignored. Expected behavior would be a 400 error.
[x] /quota
[x] /share
#2: Values set to zero are silently ignored. These should be allowed.
[x] /quota
[ ] /share
#3: Providing a non-positive value can also result in other positive values provided in the same query to be silently dropped. This is due to a logic error in the loop base case.
[x] /quota
[ ] /share
With regard to #3 above, it might be worthwhile to do an audit of anywhere that loop is used in the codebase to check for similar logic errors. In this case, it appears that replacing the loop with mapcat or another higher-order function would result in clearer (and correct) code.
Posting to the
/quota
or/share
endpoints with a resource value that's negative or zero doesn't result in the correct behavior.#1
: Negative values are silently ignored. Expected behavior would be a 400 error./quota
/share
#2
: Values set to zero are silently ignored. These should be allowed./quota
/share
#3
: Providing a non-positive value can also result in other positive values provided in the same query to be silently dropped. This is due to a logic error in theloop
base case./quota
/share
With regard to
#3
above, it might be worthwhile to do an audit of anywhere thatloop
is used in the codebase to check for similar logic errors. In this case, it appears that replacing theloop
withmapcat
or another higher-order function would result in clearer (and correct) code.