mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
fix: send file type based on its extension
This commit is contained in:
@@ -202,6 +202,9 @@ export default class AnonymizedFile {
|
||||
async send(res: Response): Promise<void> {
|
||||
const pipe = promisify(pipeline);
|
||||
try {
|
||||
if (await this.extension()) {
|
||||
res.contentType(await this.extension());
|
||||
}
|
||||
await pipe(await this.anonymizedContent(), res);
|
||||
} catch (error) {
|
||||
handleError(error, res);
|
||||
|
||||
Reference in New Issue
Block a user