mirror of
https://github.com/imgfloat/server.git
synced 2026-11-05 06:44:08 +00:00
Ensure canvas size remains within limits
This commit is contained in:
1 parent
acc2bf4538
commit
8a76ab2fb9
1 file changed
+3
-1
@@ -733,7 +733,9 @@ public class ChannelDirectoryService {
|
|||||||
BAD_REQUEST,
|
BAD_REQUEST,
|
||||||
"Canvas width out of range [0 to " + canvasMaxSizePixels + "]"
|
"Canvas width out of range [0 to " + canvasMaxSizePixels + "]"
|
||||||
);
|
);
|
||||||
if (req.getHeight() == null || req.getHeight() <= 0) throw new ResponseStatusException(
|
if (
|
||||||
|
req.getHeight() == null || req.getHeight() <= 0 || req.getHeight() > canvasMaxSizePixels
|
||||||
|
) throw new ResponseStatusException(
|
||||||
BAD_REQUEST,
|
BAD_REQUEST,
|
||||||
"Canvas height out of range [0 to " + canvasMaxSizePixels + "]"
|
"Canvas height out of range [0 to " + canvasMaxSizePixels + "]"
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user