/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['middleware/static.js']) {
  _$jscoverage['middleware/static.js'] = [];
  _$jscoverage['middleware/static.js'][13] = 0;
  _$jscoverage['middleware/static.js'][45] = 0;
  _$jscoverage['middleware/static.js'][46] = 0;
  _$jscoverage['middleware/static.js'][49] = 0;
  _$jscoverage['middleware/static.js'][52] = 0;
  _$jscoverage['middleware/static.js'][54] = 0;
  _$jscoverage['middleware/static.js'][55] = 0;
  _$jscoverage['middleware/static.js'][56] = 0;
  _$jscoverage['middleware/static.js'][57] = 0;
  _$jscoverage['middleware/static.js'][59] = 0;
  _$jscoverage['middleware/static.js'][60] = 0;
  _$jscoverage['middleware/static.js'][61] = 0;
  _$jscoverage['middleware/static.js'][64] = 0;
  _$jscoverage['middleware/static.js'][65] = 0;
  _$jscoverage['middleware/static.js'][66] = 0;
  _$jscoverage['middleware/static.js'][67] = 0;
  _$jscoverage['middleware/static.js'][68] = 0;
  _$jscoverage['middleware/static.js'][69] = 0;
  _$jscoverage['middleware/static.js'][72] = 0;
  _$jscoverage['middleware/static.js'][73] = 0;
  _$jscoverage['middleware/static.js'][74] = 0;
  _$jscoverage['middleware/static.js'][77] = 0;
  _$jscoverage['middleware/static.js'][94] = 0;
}
_$jscoverage['middleware/static.js'][13]++;
var send = require("send"), utils = require("../utils"), parse = utils.parseUrl, url = require("url");
_$jscoverage['middleware/static.js'][45]++;
exports = module.exports = (function static(root, options) {
  _$jscoverage['middleware/static.js'][46]++;
  options = options || {};
  _$jscoverage['middleware/static.js'][49]++;
  if (! root) {
    _$jscoverage['middleware/static.js'][49]++;
    throw new Error("static() root path required");
  }
  _$jscoverage['middleware/static.js'][52]++;
  var redirect = false !== options.redirect;
  _$jscoverage['middleware/static.js'][54]++;
  return (function static(req, res, next) {
  _$jscoverage['middleware/static.js'][55]++;
  if ("GET" != req.method && "HEAD" != req.method) {
    _$jscoverage['middleware/static.js'][55]++;
    return next();
  }
  _$jscoverage['middleware/static.js'][56]++;
  var path = parse(req).pathname;
  _$jscoverage['middleware/static.js'][57]++;
  var pause = utils.pause(req);
  _$jscoverage['middleware/static.js'][59]++;
  function resume() {
    _$jscoverage['middleware/static.js'][60]++;
    next();
    _$jscoverage['middleware/static.js'][61]++;
    pause.resume();
}
  _$jscoverage['middleware/static.js'][64]++;
  function directory() {
    _$jscoverage['middleware/static.js'][65]++;
    if (! redirect) {
      _$jscoverage['middleware/static.js'][65]++;
      return resume();
    }
    _$jscoverage['middleware/static.js'][66]++;
    var pathname = url.parse(req.originalUrl).pathname;
    _$jscoverage['middleware/static.js'][67]++;
    res.statusCode = 301;
    _$jscoverage['middleware/static.js'][68]++;
    res.setHeader("Location", pathname + "/");
    _$jscoverage['middleware/static.js'][69]++;
    res.end("Redirecting to " + utils.escape(pathname) + "/");
}
  _$jscoverage['middleware/static.js'][72]++;
  function error(err) {
    _$jscoverage['middleware/static.js'][73]++;
    if (404 == err.status) {
      _$jscoverage['middleware/static.js'][73]++;
      return resume();
    }
    _$jscoverage['middleware/static.js'][74]++;
    next(err);
}
  _$jscoverage['middleware/static.js'][77]++;
  send(req, path).maxage(options.maxAge || 0).root(root).hidden(options.hidden).on("error", error).on("directory", directory).pipe(res);
});
});
_$jscoverage['middleware/static.js'][94]++;
exports.mime = send.mime;
_$jscoverage['middleware/static.js'].source = ["","/*!"," * Connect - static"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var send = require('send')","  , utils = require('../utils')","  , parse = utils.parseUrl","  , url = require('url');","","/**"," * Static:"," *"," *   Static file server with the given `root` path."," *"," * Examples:"," *"," *     var oneDay = 86400000;"," *"," *     connect()"," *       .use(connect.static(__dirname + '/public'))"," *"," *     connect()"," *       .use(connect.static(__dirname + '/public', { maxAge: oneDay }))"," *"," * Options:"," *"," *    - `maxAge`     Browser cache maxAge in milliseconds. defaults to 0"," *    - `hidden`     Allow transfer of hidden files. defaults to false"," *    - `redirect`   Redirect to trailing \"/\" when the pathname is a dir. defaults to true"," *"," * @param {String} root"," * @param {Object} options"," * @return {Function}"," * @api public"," */","","exports = module.exports = function static(root, options){","  options = options || {};","","  // root required","  if (!root) throw new Error('static() root path required');","","  // default redirect","  var redirect = false !== options.redirect;","","  return function static(req, res, next) {","    if ('GET' != req.method &amp;&amp; 'HEAD' != req.method) return next();","    var path = parse(req).pathname;","    var pause = utils.pause(req);","","    function resume() {","      next();","      pause.resume();","    }","","    function directory() {","      if (!redirect) return resume();","      var pathname = url.parse(req.originalUrl).pathname;","      res.statusCode = 301;","      res.setHeader('Location', pathname + '/');","      res.end('Redirecting to ' + utils.escape(pathname) + '/');","    }","","    function error(err) {","      if (404 == err.status) return resume();","      next(err);","    }","","    send(req, path)","      .maxage(options.maxAge || 0)","      .root(root)","      .hidden(options.hidden)","      .on('error', error)","      .on('directory', directory)","      .pipe(res);","  };","};","","/**"," * Expose mime module."," * "," * If you wish to extend the mime table use this"," * reference to the \"mime\" module in the npm registry."," */","","exports.mime = send.mime;"];
