1
0
Fork 0

adjust index fallback filename

This commit is contained in:
Conduitry 2022-09-20 21:27:46 -04:00
parent 629288c03e
commit 8a27afc19f
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ for (const har_path of process.argv.slice(2)) {
let path = decodeURI(entry.request.url.slice(entry.request.url.indexOf('://') + 3).replace(/\?.*/, ''));
mkdirSync(dest + '/' + path.slice(0, path.lastIndexOf('/')), { recursive: true });
if (path.endsWith('/')) {
path += '__' + encodeURIComponent(entry.response.headers.find((_) => _.name.toLowerCase() === 'content-type')?.value);
path += '__' + entry.response.content.mimeType.replace(/[^A-Za-z0-9]/g, '_');
console.log(`Using fallback for filename: ${path}`);
}
if (entry.response.content.text == null) {