Skip to content

Commit 853ae3e

Browse files
authored
fix: error message for upload size limit (#8192)
1 parent 5535a4a commit 853ae3e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎apps/labrinth/src/routes/v3/project_creation.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,8 @@ async fn process_icon_upload(
12411241
) -> Result<(String, String, Option<u32>), CreateError> {
12421242
let data = read_from_field(
12431243
&mut field,
1244-
524288,
1245-
"Icons must be smaller than 512KiB",
1244+
2 * 1024 * 1024,
1245+
"icons must be smaller than 2MiB",
12461246
)
12471247
.await?;
12481248
let upload_result = crate::util::img::upload_image_optimized(

‎apps/labrinth/src/routes/v3/projects/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,8 +2544,8 @@ pub async fn project_icon_edit_internal(
25442544

25452545
let bytes = read_limited_from_payload(
25462546
&mut payload,
2547-
524288,
2548-
"Icons must be smaller than 512KiB",
2547+
2 * 1024 * 1024,
2548+
"icons must be smaller than 2MiB",
25492549
)
25502550
.await?;
25512551

‎apps/labrinth/src/routes/v3/users.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,8 +1237,8 @@ pub async fn user_icon_edit(
12371237

12381238
let bytes = read_limited_from_payload(
12391239
&mut payload,
1240-
524288,
1241-
"Icons must be smaller than 512KiB",
1240+
2 * 1024 * 1024,
1241+
"icons must be smaller than 2MiB",
12421242
)
12431243
.await?;
12441244

0 commit comments

Comments
 (0)