Skip to content
Snippets Groups Projects
Commit 38fdc73d authored by tamaina's avatar tamaina
Browse files

Fix?(server): Content-Dispositionのパースでエラーが発生した場合にもダウンロードが完了するように

#10626
parent bcbf06ac
No related branches found
No related tags found
No related merge requests found
......@@ -86,9 +86,13 @@ export class DownloadService {
const contentDisposition = res.headers['content-disposition'];
if (contentDisposition != null) {
const parsed = parse(contentDisposition);
if (parsed.parameters.filename) {
filename = parsed.parameters.filename;
try {
const parsed = parse(contentDisposition);
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) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment