From c2b83bf62efe1ca709831c63eb9e23ccee50638d Mon Sep 17 00:00:00 2001 From: sunaurus Date: Wed, 28 Jun 2023 21:09:17 +0300 Subject: [PATCH] Handle 413 response on image uploads --- src/http.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/http.ts b/src/http.ts index 4fe1ecb7..1992d639 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1284,6 +1284,10 @@ export class LemmyHttp { }, }); + if (response.status === 413) { + return { msg: "too_large" }; + } + const responseJson = await response.json(); if (responseJson.msg === "ok") {