Skip to content

Commit

Permalink
Handle 413 response on image uploads (#154)
Browse files Browse the repository at this point in the history
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
  • Loading branch information
sunaurus and dessalines authored Jul 3, 2023
1 parent 0a9c151 commit d497a1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,10 @@ export class LemmyHttp {
},
});

if (response.status === 413) {
return { msg: "too_large" };
}

const responseJson = await response.json();

if (responseJson.msg === "ok") {
Expand Down

0 comments on commit d497a1e

Please sign in to comment.