Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/api/v1/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ import { isUuid, type Uuid } from "../../uuid";
import { timelineQuerySchema } from "./timelines";

const app = new Hono<{ Variables: AccountOwnerVariables }>();
const allowedImageMimeTypes = ["image/gif", "image/jpeg", "image/png"];
const allowedImageMimeTypes = [
"image/gif",
"image/jpeg",
"image/png",
"image/webp",
];

app.get(
"/verify_credentials",
Expand Down
15 changes: 10 additions & 5 deletions src/pages/accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ const HOLLO_OFFICIAL_ACCOUNT = "@hollo@hollo.social";

const logger = getLogger(["hollo", "pages", "accounts"]);

const allowedImageMimeTypes = ["image/gif", "image/jpeg", "image/png"];
const allowedImageMimeTypes = [
"image/gif",
"image/jpeg",
"image/png",
"image/webp",
];
Comment thread
naskya marked this conversation as resolved.

export function parseFields(
form: FormData,
Expand Down Expand Up @@ -194,7 +199,7 @@ accounts.post("/", async (c) => {
news,
fields: parsedFields,
}}
errors={{ avatar: "Avatar must be a JPEG, PNG, or GIF." }}
errors={{ avatar: "Avatar must be a JPEG, PNG, WEBP, or GIF." }}
officialAccount={HOLLO_OFFICIAL_ACCOUNT}
host={getInstanceHost(new URL(c.req.url))}
/>,
Expand Down Expand Up @@ -222,7 +227,7 @@ accounts.post("/", async (c) => {
news,
fields: parsedFields,
}}
errors={{ header: "Header image must be a JPEG, PNG, or GIF." }}
errors={{ header: "Header image must be a JPEG, PNG, WEBP, or GIF." }}
officialAccount={HOLLO_OFFICIAL_ACCOUNT}
host={getInstanceHost(new URL(c.req.url))}
/>,
Expand Down Expand Up @@ -596,7 +601,7 @@ accounts.post("/:id", async (c) => {
coverUrl: accountOwner.account.coverUrl,
fields: parsedFields,
}}
errors={{ avatar: "Avatar must be a JPEG, PNG, or GIF." }}
errors={{ avatar: "Avatar must be a JPEG, PNG, WEBP, or GIF." }}
officialAccount={HOLLO_OFFICIAL_ACCOUNT}
host={getInstanceHost(new URL(c.req.url))}
/>,
Expand Down Expand Up @@ -627,7 +632,7 @@ accounts.post("/:id", async (c) => {
coverUrl: accountOwner.account.coverUrl,
fields: parsedFields,
}}
errors={{ header: "Header image must be a JPEG, PNG, or GIF." }}
errors={{ header: "Header image must be a JPEG, PNG, WEBP, or GIF." }}
officialAccount={HOLLO_OFFICIAL_ACCOUNT}
host={getInstanceHost(new URL(c.req.url))}
/>,
Expand Down
Loading