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
|
|
@ -6,7 +6,6 @@ import { WebFinger } from "@versia/federation/schemas";
|
|||
import { User } from "@versia/kit/db";
|
||||
import { Users } from "@versia/kit/tables";
|
||||
import { and, eq, isNull } from "drizzle-orm";
|
||||
import { lookup } from "mime-types";
|
||||
import { z } from "zod";
|
||||
import { config } from "~/packages/config-manager";
|
||||
import { ErrorSchema } from "~/types/api";
|
||||
|
|
@ -137,9 +136,8 @@ export default apiRoute((app) =>
|
|||
},
|
||||
{
|
||||
rel: "avatar",
|
||||
// TODO: don't... don't use the mime type from the file extension
|
||||
type:
|
||||
lookup(user.getAvatarUrl(config)) ||
|
||||
user.data.source.avatar?.content_type ||
|
||||
"application/octet-stream",
|
||||
href: user.getAvatarUrl(config),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue