/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['middleware/favicon.js']) {
  _$jscoverage['middleware/favicon.js'] = [];
  _$jscoverage['middleware/favicon.js'][13] = 0;
  _$jscoverage['middleware/favicon.js'][50] = 0;
  _$jscoverage['middleware/favicon.js'][51] = 0;
  _$jscoverage['middleware/favicon.js'][56] = 0;
  _$jscoverage['middleware/favicon.js'][57] = 0;
  _$jscoverage['middleware/favicon.js'][58] = 0;
  _$jscoverage['middleware/favicon.js'][59] = 0;
  _$jscoverage['middleware/favicon.js'][60] = 0;
  _$jscoverage['middleware/favicon.js'][62] = 0;
  _$jscoverage['middleware/favicon.js'][63] = 0;
  _$jscoverage['middleware/favicon.js'][64] = 0;
  _$jscoverage['middleware/favicon.js'][73] = 0;
  _$jscoverage['middleware/favicon.js'][74] = 0;
  _$jscoverage['middleware/favicon.js'][78] = 0;
}
_$jscoverage['middleware/favicon.js'][13]++;
var fs = require("fs"), utils = require("../utils");
_$jscoverage['middleware/favicon.js'][50]++;
module.exports = (function favicon(path, options) {
  _$jscoverage['middleware/favicon.js'][51]++;
  var options = options || {}, path = path || __dirname + "/../public/favicon.ico", maxAge = options.maxAge || 86400000, icon;
  _$jscoverage['middleware/favicon.js'][56]++;
  return (function favicon(req, res, next) {
  _$jscoverage['middleware/favicon.js'][57]++;
  if ("/favicon.ico" == req.url) {
    _$jscoverage['middleware/favicon.js'][58]++;
    if (icon) {
      _$jscoverage['middleware/favicon.js'][59]++;
      res.writeHead(200, icon.headers);
      _$jscoverage['middleware/favicon.js'][60]++;
      res.end(icon.body);
    }
    else {
      _$jscoverage['middleware/favicon.js'][62]++;
      fs.readFile(path, (function (err, buf) {
  _$jscoverage['middleware/favicon.js'][63]++;
  if (err) {
    _$jscoverage['middleware/favicon.js'][63]++;
    return next(err);
  }
  _$jscoverage['middleware/favicon.js'][64]++;
  icon = {headers: {"Content-Type": "image/x-icon", "Content-Length": buf.length, "ETag": "\"" + utils.md5(buf) + "\"", "Cache-Control": "public, max-age=" + (maxAge / 1000)}, body: buf};
  _$jscoverage['middleware/favicon.js'][73]++;
  res.writeHead(200, icon.headers);
  _$jscoverage['middleware/favicon.js'][74]++;
  res.end(icon.body);
}));
    }
  }
  else {
    _$jscoverage['middleware/favicon.js'][78]++;
    next();
  }
});
});
_$jscoverage['middleware/favicon.js'].source = ["","/*!"," * Connect - favicon"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var fs = require('fs')","  , utils = require('../utils');","","/**"," * Favicon:"," *"," * By default serves the connect favicon, or the favicon"," * located by the given `path`."," *"," * Options:"," *"," *   - `maxAge`  cache-control max-age directive, defaulting to 1 day"," *"," * Examples:"," *"," *   Serve default favicon:"," *"," *     connect()"," *       .use(connect.favicon())"," *"," *   Serve favicon before logging for brevity:"," *"," *     connect()"," *       .use(connect.favicon())"," *       .use(connect.logger('dev'))"," *"," *   Serve custom favicon:"," *"," *     connect()"," *       .use(connect.favicon('public/favicon.ico))"," *"," * @param {String} path"," * @param {Object} options"," * @return {Function}"," * @api public"," */","","module.exports = function favicon(path, options){","  var options = options || {}","    , path = path || __dirname + '/../public/favicon.ico'","    , maxAge = options.maxAge || 86400000","    , icon; // favicon cache","","  return function favicon(req, res, next){","    if ('/favicon.ico' == req.url) {","      if (icon) {","        res.writeHead(200, icon.headers);","        res.end(icon.body);","      } else {","        fs.readFile(path, function(err, buf){","          if (err) return next(err);","          icon = {","            headers: {","                'Content-Type': 'image/x-icon'","              , 'Content-Length': buf.length","              , 'ETag': '\"' + utils.md5(buf) + '\"'","              , 'Cache-Control': 'public, max-age=' + (maxAge / 1000)","            },","            body: buf","          };","          res.writeHead(200, icon.headers);","          res.end(icon.body);","        });","      }","    } else {","      next();","    }","  };","};"];
