aboutsummaryrefslogtreecommitdiff
path: root/src/request.gleam
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-18 01:01:41 +0000
committerFuwn <[email protected]>2026-04-18 01:05:13 +0000
commit53fac17bbcaa2957235b54b6e24e835cabca2033 (patch)
treec15f761fb4faeb9cfad7716ec76eea6f7059f7ec /src/request.gleam
parentrefactor: Tighten dead branches and fail fast on missing index.html (diff)
downloadmayu-53fac17bbcaa2957235b54b6e24e835cabca2033.tar.xz
mayu-53fac17bbcaa2957235b54b6e24e835cabca2033.zip
fix: Harden startup + SVG input handling
Diffstat (limited to 'src/request.gleam')
-rw-r--r--src/request.gleam2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/request.gleam b/src/request.gleam
index 82048af..a56780b 100644
--- a/src/request.gleam
+++ b/src/request.gleam
@@ -45,7 +45,7 @@ pub fn handle(request, connection, image_cache, index_html) {
case list.key_find(query, "padding") {
Ok(padding) ->
case int.parse(padding) {
- Ok(n) -> n
+ Ok(n) -> int.clamp(n, min: 0, max: 32)
Error(_) -> 6
}
_ -> 6