Skip to content

Commit ddd525a

Browse files
committed
Increased limit
1 parent c2cc1e8 commit ddd525a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/com/ashampoo/imageproxy/Routing.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ private val validQualityRange = 10..100
4242
private const val DEFAULT_LONG_SIDE_PX = 480
4343
private const val DEFAULT_QUALITY = 90
4444

45+
private const val MAX_LONG_SIDE_PX = 2048
46+
4547
private const val DEFAULT_TARGET_FORMAT = ".jpg"
4648

4749
private val httpClient = HttpClient()
@@ -72,11 +74,11 @@ fun Application.configureRouting() {
7274

7375
val authToken = call.request.header(AUTHORIZATION_HEADER)
7476

75-
if (longSidePx > 2000) {
77+
if (longSidePx > MAX_LONG_SIDE_PX) {
7678

7779
call.respond(
7880
status = HttpStatusCode.BadRequest,
79-
message = "LongSidePx size must be lower than 2000px: $longSidePx"
81+
message = "LongSidePx size must be lower than $MAX_LONG_SIDE_PX pixels: $longSidePx"
8082
)
8183

8284
return@get

0 commit comments

Comments
 (0)