mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 13:47:59 +02: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> {
|
async send(res: Response): Promise<void> {
|
||||||
const pipe = promisify(pipeline);
|
const pipe = promisify(pipeline);
|
||||||
try {
|
try {
|
||||||
|
if (await this.extension()) {
|
||||||
|
res.contentType(await this.extension());
|
||||||
|
}
|
||||||
await pipe(await this.anonymizedContent(), res);
|
await pipe(await this.anonymizedContent(), res);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, res);
|
handleError(error, res);
|
||||||
|
|||||||
Reference in New Issue
Block a user