Skip to content

Commit af7d76e

Browse files
limeburstclaude
andcommitted
control-plane: Allow uploading web font files (woff, woff2, ttf, otf, eot)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ca4029c commit af7d76e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

control-plane/src/lib/const.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export const EDITABLE_FILE_EXTENSION_MAP: Record<string, string | null> = {
1818
export const FILE_EXTENSION_MIMETYPE_MAP: Record<
1919
| keyof typeof EDITABLE_FILE_EXTENSION_MAP
2020
| (typeof AUDIO_FILE_EXTENSIONS)[number]
21-
| (typeof IMAGE_FILE_EXTENSIONS)[number],
21+
| (typeof IMAGE_FILE_EXTENSIONS)[number]
22+
| (typeof FONT_FILE_EXTENSIONS)[number],
2223
string
2324
> = {
2425
html: "text/html",
@@ -45,6 +46,11 @@ export const FILE_EXTENSION_MIMETYPE_MAP: Record<
4546
opus: "audio/opus",
4647
mid: "audio/midi",
4748
midi: "audio/midi",
49+
woff: "font/woff",
50+
woff2: "font/woff2",
51+
ttf: "font/ttf",
52+
otf: "font/otf",
53+
eot: "application/vnd.ms-fontobject",
4854
};
4955

5056
export const EDITABLE_FILE_EXTENSIONS = Object.keys(
@@ -69,10 +75,19 @@ export const IMAGE_FILE_EXTENSIONS = [
6975
"ico",
7076
];
7177

78+
export const FONT_FILE_EXTENSIONS = [
79+
"woff",
80+
"woff2",
81+
"ttf",
82+
"otf",
83+
"eot",
84+
];
85+
7286
export const ALLOWED_FILE_EXTENSIONS = [
7387
...EDITABLE_FILE_EXTENSIONS,
7488
...AUDIO_FILE_EXTENSIONS,
7589
...IMAGE_FILE_EXTENSIONS,
90+
...FONT_FILE_EXTENSIONS,
7691
];
7792

7893
export const DEFAULT_INDEX_HTML = `<!DOCTYPE html>

0 commit comments

Comments
 (0)