Skip to content

Commit

Permalink
merged conditional header fields from master
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 15, 2011
1 parent 5f600e9 commit 06cbd48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/middleware/static.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ var send = exports.send = function(req, res, next, options){
// stream the entire file // stream the entire file
} else { } else {
res.setHeader('Content-Length', stat.size); res.setHeader('Content-Length', stat.size);
res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000)); if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000));
res.setHeader('Last-Modified', stat.mtime.toUTCString()); if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString());
res.setHeader('ETag', utils.etag(stat)); if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat));


// conditional GET support // conditional GET support
if (utils.conditionalGET(req)) { if (utils.conditionalGET(req)) {
Expand Down

0 comments on commit 06cbd48

Please sign in to comment.