mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(api): 🐛 Fetch media content-type from data, instead of doing naive guesses
This commit is contained in:
parent
6f67881d96
commit
4fdb96930f
8 changed files with 111 additions and 23 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { mimeLookup } from "@/content_types.ts";
|
||||
import { randomString } from "@/math.ts";
|
||||
import { setCookie } from "@hono/hono/cookie";
|
||||
import { createRoute, z } from "@hono/zod-openapi";
|
||||
|
|
@ -245,7 +246,12 @@ export default (plugin: PluginType): void => {
|
|||
const user = await User.fromDataLocal({
|
||||
email: doesEmailExist ? undefined : email,
|
||||
username,
|
||||
avatar: picture,
|
||||
avatar: picture
|
||||
? {
|
||||
url: picture,
|
||||
content_type: await mimeLookup(picture),
|
||||
}
|
||||
: undefined,
|
||||
password: undefined,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue