Skip to content

Commit

Permalink
require a truthy name when setting the content disposition header
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzo committed Jun 27, 2023
1 parent 30ba43a commit c8e8eab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions container/nginx/njs/ipfs-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ function setHeaders(req) {
name = `${cid}.bin`;
}

const value = `attachment; filename="${name}"`;
req.headersOut["content-disposition"] = value;
if (name) {
const value = `attachment; filename="${name}"`;
req.headersOut["content-disposition"] = value;
}
}

export default { setHeaders };

0 comments on commit c8e8eab

Please sign in to comment.