mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-30 22:09:35 +02:00
fix: send file type based on its extension
This commit is contained in:
1 parent
2c2a3714c5
commit
3091b13776
1 file changed
+3
@@ -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