mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Ensure canvas size remains within limits
This commit is contained in:
@@ -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