@@ -2,10 +2,10 @@ import {
|
||||
ConnInfo,
|
||||
extname,
|
||||
fromFileUrl,
|
||||
mediaTypeLookup,
|
||||
RequestHandler,
|
||||
router,
|
||||
toFileUrl,
|
||||
typeByExtension,
|
||||
walk,
|
||||
} from "./deps.ts";
|
||||
import { h } from "preact";
|
||||
@@ -224,7 +224,7 @@ export class ServerContext {
|
||||
const localUrl = toFileUrl(entry.path);
|
||||
const path = localUrl.href.substring(staticFolder.href.length);
|
||||
const stat = await Deno.stat(localUrl);
|
||||
const contentType = mediaTypeLookup(extname(path)) ??
|
||||
const contentType = typeByExtension(extname(path)) ??
|
||||
"application/octet-stream";
|
||||
const etag = await crypto.subtle.digest(
|
||||
"SHA-1",
|
||||
@@ -559,7 +559,7 @@ export class ServerContext {
|
||||
"Cache-Control": "public, max-age=604800, immutable",
|
||||
});
|
||||
|
||||
const contentType = mediaTypeLookup(path);
|
||||
const contentType = typeByExtension(extname(path));
|
||||
if (contentType) {
|
||||
headers.set("Content-Type", contentType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user