mirror of
https://github.com/versia-pub/server.git
synced 2026-01-26 20:26:01 +01:00
Fix incorrect MIME type when uploading emojis
This commit is contained in:
parent
c26bf72542
commit
ee6b6bce34
6
cli.ts
6
cli.ts
|
|
@ -14,6 +14,7 @@ import { getUrl } from "~database/entities/Attachment";
|
||||||
import { createNewLocalUser } from "~database/entities/User";
|
import { createNewLocalUser } from "~database/entities/User";
|
||||||
import { CliParameterType } from "~packages/cli-parser/cli-builder.type";
|
import { CliParameterType } from "~packages/cli-parser/cli-builder.type";
|
||||||
import { config } from "~packages/config-manager";
|
import { config } from "~packages/config-manager";
|
||||||
|
import { lookup } from "mime-types";
|
||||||
|
|
||||||
const args = process.argv;
|
const args = process.argv;
|
||||||
|
|
||||||
|
|
@ -1259,10 +1260,7 @@ const cliBuilder = new CliBuilder([
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the emoji
|
// Add the emoji
|
||||||
const content_type = `image/${url
|
const content_type = lookup(newUrl) || "application/octet-stream";
|
||||||
.split(".")
|
|
||||||
.pop()
|
|
||||||
?.replace("jpg", "jpeg")}}`;
|
|
||||||
|
|
||||||
const emoji = await client.emoji.create({
|
const emoji = await client.emoji.create({
|
||||||
data: {
|
data: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue