/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['middleware/methodOverride.js']) {
  _$jscoverage['middleware/methodOverride.js'] = [];
  _$jscoverage['middleware/methodOverride.js'][23] = 0;
  _$jscoverage['middleware/methodOverride.js'][24] = 0;
  _$jscoverage['middleware/methodOverride.js'][25] = 0;
  _$jscoverage['middleware/methodOverride.js'][26] = 0;
  _$jscoverage['middleware/methodOverride.js'][29] = 0;
  _$jscoverage['middleware/methodOverride.js'][30] = 0;
  _$jscoverage['middleware/methodOverride.js'][31] = 0;
  _$jscoverage['middleware/methodOverride.js'][33] = 0;
  _$jscoverage['middleware/methodOverride.js'][34] = 0;
  _$jscoverage['middleware/methodOverride.js'][37] = 0;
}
_$jscoverage['middleware/methodOverride.js'][23]++;
module.exports = (function methodOverride(key) {
  _$jscoverage['middleware/methodOverride.js'][24]++;
  key = key || "_method";
  _$jscoverage['middleware/methodOverride.js'][25]++;
  return (function methodOverride(req, res, next) {
  _$jscoverage['middleware/methodOverride.js'][26]++;
  req.originalMethod = req.originalMethod || req.method;
  _$jscoverage['middleware/methodOverride.js'][29]++;
  if (req.body && key in req.body) {
    _$jscoverage['middleware/methodOverride.js'][30]++;
    req.method = req.body[key].toUpperCase();
    _$jscoverage['middleware/methodOverride.js'][31]++;
    delete req.body[key];
  }
  else {
    _$jscoverage['middleware/methodOverride.js'][33]++;
    if (req.headers["x-http-method-override"]) {
      _$jscoverage['middleware/methodOverride.js'][34]++;
      req.method = req.headers["x-http-method-override"].toUpperCase();
    }
  }
  _$jscoverage['middleware/methodOverride.js'][37]++;
  next();
});
});
_$jscoverage['middleware/methodOverride.js'].source = ["","/*!"," * Connect - methodOverride"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Method Override:"," * "," * Provides faux HTTP method support."," * "," * Pass an optional `key` to use when checking for"," * a method override, othewise defaults to _\\_method_."," * The original method is available via `req.originalMethod`."," *"," * @param {String} key"," * @return {Function}"," * @api public"," */","","module.exports = function methodOverride(key){","  key = key || \"_method\";","  return function methodOverride(req, res, next) {","    req.originalMethod = req.originalMethod || req.method;","","    // req.body","    if (req.body &amp;&amp; key in req.body) {","      req.method = req.body[key].toUpperCase();","      delete req.body[key];","    // check X-HTTP-Method-Override","    } else if (req.headers['x-http-method-override']) {","      req.method = req.headers['x-http-method-override'].toUpperCase();","    }","    ","    next();","  };","};",""];
