Skip to content

Commit

Permalink
fix: file content type
Browse files Browse the repository at this point in the history
  • Loading branch information
artufimtcev committed Sep 11, 2024
1 parent fddfc82 commit 815bbc9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions platform/src/components/aws/ssr-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ export function createServersAndDistribution(
[".css"]: { mime: "text/css", isText: true },
[".js"]: { mime: "text/javascript", isText: true },
[".mjs"]: { mime: "text/javascript", isText: true },
[".cjs"]: { mime: "text/javascript", isText: true },
[".apng"]: { mime: "image/apng", isText: false },
[".avif"]: { mime: "image/avif", isText: false },
[".gif"]: { mime: "image/gif", isText: false },
Expand Down
3 changes: 2 additions & 1 deletion platform/src/components/aws/static-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ export class StaticSite extends Component implements Link.Linkable {
key: path.posix.join(assets.path ?? "", file),
hash,
cacheControl: fileOption.cacheControl,
contentType: getContentType(file, "UTF-8"),
contentType: fileOption.contentType ?? getContentType(file, "UTF-8"),
};
}),
)),
Expand Down Expand Up @@ -695,6 +695,7 @@ export class StaticSite extends Component implements Link.Linkable {
[".css"]: { mime: "text/css", isText: true },
[".js"]: { mime: "text/javascript", isText: true },
[".mjs"]: { mime: "text/javascript", isText: true },
[".cjs"]: { mime: "text/javascript", isText: true },
[".apng"]: { mime: "image/apng", isText: false },
[".avif"]: { mime: "image/avif", isText: false },
[".gif"]: { mime: "image/gif", isText: false },
Expand Down
3 changes: 2 additions & 1 deletion platform/src/components/cloudflare/ssr-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function createRouter(
key: path.posix.join(copy.to, file),
hash,
cacheControl: fileOption.cacheControl,
contentType: getContentType(file, "UTF-8"),
contentType: fileOption.contentType ?? getContentType(file, "UTF-8"),
};
}),
)),
Expand Down Expand Up @@ -185,6 +185,7 @@ export function createRouter(
[".css"]: { mime: "text/css", isText: true },
[".js"]: { mime: "text/javascript", isText: true },
[".mjs"]: { mime: "text/javascript", isText: true },
[".cjs"]: { mime: "text/javascript", isText: true },
[".apng"]: { mime: "image/apng", isText: false },
[".avif"]: { mime: "image/avif", isText: false },
[".gif"]: { mime: "image/gif", isText: false },
Expand Down
3 changes: 2 additions & 1 deletion platform/src/components/cloudflare/static-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export class StaticSite extends Component implements Link.Linkable {
key: file,
hash,
cacheControl: fileOption.cacheControl,
contentType: getContentType(file, "UTF-8"),
contentType: fileOption.contentType ?? getContentType(file, "UTF-8"),
};
}),
)),
Expand Down Expand Up @@ -390,6 +390,7 @@ export class StaticSite extends Component implements Link.Linkable {
[".css"]: { mime: "text/css", isText: true },
[".js"]: { mime: "text/javascript", isText: true },
[".mjs"]: { mime: "text/javascript", isText: true },
[".cjs"]: { mime: "text/javascript", isText: true },
[".apng"]: { mime: "image/apng", isText: false },
[".avif"]: { mime: "image/avif", isText: false },
[".gif"]: { mime: "image/gif", isText: false },
Expand Down

0 comments on commit 815bbc9

Please sign in to comment.