Skip to content

Commit

Permalink
fix: add Vary header when of gzip/brotli in use (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov authored Jan 30, 2021
1 parent cf787b9 commit 86e6733
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/sirv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export default function (dir, opts={}) {
return res.end();
}

if (gzips || brots) {
res.setHeader('Vary', 'Accept-Encoding');
}

setHeaders(res, pathname, data.stats);
send(req, res, data.abs, data.stats, data.headers);
};
Expand Down

0 comments on commit 86e6733

Please sign in to comment.