refactor(media): simplify content type assignment logic in media controller
This commit is contained in:
@@ -14,8 +14,7 @@ export class MediaController {
|
|||||||
const stream = await this.s3Service.getFile(key);
|
const stream = await this.s3Service.getFile(key);
|
||||||
|
|
||||||
const contentType =
|
const contentType =
|
||||||
stats.metaData?.["content-type"] ||
|
stats.metaData?.["content-type"] || "application/octet-stream";
|
||||||
"application/octet-stream";
|
|
||||||
|
|
||||||
res.setHeader("Content-Type", contentType);
|
res.setHeader("Content-Type", contentType);
|
||||||
res.setHeader("Content-Length", stats.size);
|
res.setHeader("Content-Length", stats.size);
|
||||||
|
|||||||
Reference in New Issue
Block a user