summaryrefslogtreecommitdiff
path: root/std/http/file_server.ts
diff options
context:
space:
mode:
author木杉 <zhmushan@qq.com>2020-04-07 22:06:22 +0800
committerGitHub <noreply@github.com>2020-04-07 10:06:22 -0400
commit481fcfc8bd291c678d14b20c7c34a925503b8507 (patch)
treea6b3e8073247b55c6b5f3320a92a166a9b1ce3d3 /std/http/file_server.ts
parente586d0c8b813c276cd5a1ba30582022b3c2be2eb (diff)
file_server: use text/typescript instead of application/typescript (#4620)
I just tried it and found that using application/typescript, the browser will download the file directly, I think that .ts should be mapped to application/javascript or text/typescript
Diffstat (limited to 'std/http/file_server.ts')
-rwxr-xr-xstd/http/file_server.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/http/file_server.ts b/std/http/file_server.ts
index 79f3e5081..468e8a60e 100755
--- a/std/http/file_server.ts
+++ b/std/http/file_server.ts
@@ -47,10 +47,10 @@ const MEDIA_TYPES: Record<string, string> = {
".json": "application/json",
".map": "application/json",
".txt": "text/plain",
- ".ts": "application/typescript",
- ".tsx": "application/typescript",
+ ".ts": "text/typescript",
+ ".tsx": "text/tsx",
".js": "application/javascript",
- ".jsx": "application/jsx",
+ ".jsx": "text/jsx",
".gz": "application/gzip",
};