Skip to content

Commit

Permalink
fix custom max age
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyKhristov authored and dead-horse committed Feb 21, 2015
1 parent 30fc14d commit 7b47765
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ function safeDecodeURIComponent(text) {

function loadFile(name, dir, options, files) {
var pathname = options.prefix + name
var obj = files[pathname] = {}
var obj = files[pathname] = files[pathname] ? files[pathname] : {}
var filename = obj.path = path.join(dir, name)
var stats = fs.statSync(filename)
var buffer = fs.readFileSync(filename)

obj.cacheControl = options.cacheControl
obj.maxAge = options.maxAge || 0
obj.maxAge = obj.maxAge ? obj.maxAge : options.maxAge || 0
obj.type = obj.mime = mime.lookup(pathname) || 'application/octet-stream'
obj.mtime = stats.mtime.toUTCString()
obj.length = stats.size
Expand Down

0 comments on commit 7b47765

Please sign in to comment.