Created
July 2, 2010 09:00
-
-
Save lsm/461125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function() { | |
var me = this, | |
writeHead = me.flaker.writeHead, | |
write = me.flaker.write, | |
contentType = mime.lookup(extname(filePath)); | |
fs.stat(filePath, function(err, stat) { | |
if (err || !stat.isFile()) { | |
errback ? errback(err) : me.error(404, 'File not found'); | |
return; | |
} | |
// you have to call this: | |
me.flaker.writeHead(); | |
// instead of this: | |
writeHead(); | |
// otherwise `this` inside `writeHead` will break | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment