mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-28 17:03:02 +00:00
Fix?(server): Content-Dispositionのパースでエラーが発生した場合にもダウンロードが完了するように
#10626
This commit is contained in:
parent
bcbf06ac8c
commit
38fdc73d01
1 changed files with 7 additions and 3 deletions
|
@ -86,9 +86,13 @@ export class DownloadService {
|
||||||
|
|
||||||
const contentDisposition = res.headers['content-disposition'];
|
const contentDisposition = res.headers['content-disposition'];
|
||||||
if (contentDisposition != null) {
|
if (contentDisposition != null) {
|
||||||
const parsed = parse(contentDisposition);
|
try {
|
||||||
if (parsed.parameters.filename) {
|
const parsed = parse(contentDisposition);
|
||||||
filename = parsed.parameters.filename;
|
if (parsed.parameters.filename) {
|
||||||
|
filename = parsed.parameters.filename;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.logger.warn(`Failed to parse content-disposition: ${contentDisposition}`, { stack: e });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).on('downloadProgress', (progress: Got.Progress) => {
|
}).on('downloadProgress', (progress: Got.Progress) => {
|
||||||
|
|
Loading…
Reference in a new issue