Skip to content

Commit

Permalink
doc: fix/add comment explaining mime type translation escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
ikadix committed Dec 7, 2021
1 parent bc02b1f commit c7ddffd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/user/profile.ts
Expand Up @@ -46,7 +46,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return res.status(422).json({
message: t("unsupported_mime_type", {
// The translation will escape the / in the mime type
// soget only the image type and pass that
// so get only the image type and pass that
// have image/ in the translation
mime_type: e.message.replace("Unsupported MIME type: image/", ""),
}),
Expand Down
3 changes: 3 additions & 0 deletions server/routers/viewer.tsx
Expand Up @@ -498,6 +498,9 @@ const loggedInViewerRouter = createProtectedRouter()
throw new TRPCError({
code: "BAD_REQUEST",
message: t("unsupported_mime_type", {
// The translation will escape the / in the mime type
// so get only the image type and pass that
// have image/ in the translation
mime_type: e.message.replace("Unsupported MIME type: image/", ""),
}),
});
Expand Down

0 comments on commit c7ddffd

Please sign in to comment.