Add content type to registry using filenames
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm
2020-10-21 02:40:55 +02:00
parent c9bd5c7d18
commit 6b88be1b18
2 changed files with 19 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import {
extractPackagePath,
getAbsolutePackageVersion,
getFile,
getContentType,
} from "../utils.ts";
import db from "../db.ts";
@ -54,6 +55,8 @@ export default function raw(g: ABC.Group) {
if (!result) return E404();
ctx.response.headers.set("e-tag", result.etag);
let contentType = getContentType(filepath);
if (contentType) ctx.response.headers.set("Content-Type", contentType);
return result.data;
});
}