Permalink
Browse files

merged conditional header fields from master

  • Loading branch information...
1 parent 5f600e9 commit 06cbd482921c6621850396866243197e0aef9102 @tj tj committed Aug 15, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/middleware/static.js
View
@@ -182,9 +182,9 @@ var send = exports.send = function(req, res, next, options){
// stream the entire file
} else {
res.setHeader('Content-Length', stat.size);
- res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000));
- res.setHeader('Last-Modified', stat.mtime.toUTCString());
- res.setHeader('ETag', utils.etag(stat));
+ if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000));
+ if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString());
+ if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat));
// conditional GET support
if (utils.conditionalGET(req)) {

0 comments on commit 06cbd48

Please sign in to comment.