Skip to content

Commit

Permalink
workaround for new webr format
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Sep 12, 2024
1 parent 195b551 commit 3ea3ac2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion routes/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ function tar_index_files(input){
var extract = tar.extract({allowUnknownFormat: true})
.on('entry', process_entry)
.on('finish', finish_stream)
.on('error', reject);
.on('error', function(err){
if (err.message.includes('Unexpected end') && files.length > 0){
finish_stream(); //workaround tar-stream bug for custom webr 0.4.2 tar headers
} else {
reject(err);
}
});


input.pipe(gunzip()).pipe(extract);
});
}
Expand Down

0 comments on commit 3ea3ac2

Please sign in to comment.