Skip to content

Commit

Permalink
Use attachement() api
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 15, 2024
1 parent 3ef27cb commit 3e1be07
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions routes/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ function send_from_bucket(hash, file, res){
} else {
let type = name.endsWith('.zip') ? 'application/zip' : 'application/x-gzip';
return stream_file(pkg).pipe(
res.type(type).set({
res.type(type).attachment(name).set({
'Content-Length': pkg.length,
'Cache-Control': 'public, max-age=31557600',
'Last-Modified' : pkg.uploadDate.toUTCString(),
'Content-Disposition' : `attachment; filename="${name}"`
'Last-Modified' : pkg.uploadDate.toUTCString()
})
);
}
Expand Down

0 comments on commit 3e1be07

Please sign in to comment.