From d497a1efea435ff0f95f53698f4025e1882d81a8 Mon Sep 17 00:00:00 2001 From: Sander Saarend Date: Tue, 4 Jul 2023 00:59:54 +0300 Subject: [PATCH] Handle 413 response on image uploads (#154) Co-authored-by: Dessalines --- src/http.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/http.ts b/src/http.ts index 4fe1ecb..1992d63 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") {