Add content type to registry using filenames
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -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;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user