/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['middleware/urlencoded.js']) {
  _$jscoverage['middleware/urlencoded.js'] = [];
  _$jscoverage['middleware/urlencoded.js'][13] = 0;
  _$jscoverage['middleware/urlencoded.js'][21] = 0;
  _$jscoverage['middleware/urlencoded.js'][22] = 0;
  _$jscoverage['middleware/urlencoded.js'][40] = 0;
  _$jscoverage['middleware/urlencoded.js'][41] = 0;
  _$jscoverage['middleware/urlencoded.js'][43] = 0;
  _$jscoverage['middleware/urlencoded.js'][47] = 0;
  _$jscoverage['middleware/urlencoded.js'][48] = 0;
  _$jscoverage['middleware/urlencoded.js'][49] = 0;
  _$jscoverage['middleware/urlencoded.js'][51] = 0;
  _$jscoverage['middleware/urlencoded.js'][54] = 0;
  _$jscoverage['middleware/urlencoded.js'][57] = 0;
  _$jscoverage['middleware/urlencoded.js'][60] = 0;
  _$jscoverage['middleware/urlencoded.js'][61] = 0;
  _$jscoverage['middleware/urlencoded.js'][62] = 0;
  _$jscoverage['middleware/urlencoded.js'][63] = 0;
  _$jscoverage['middleware/urlencoded.js'][64] = 0;
  _$jscoverage['middleware/urlencoded.js'][65] = 0;
  _$jscoverage['middleware/urlencoded.js'][66] = 0;
  _$jscoverage['middleware/urlencoded.js'][67] = 0;
  _$jscoverage['middleware/urlencoded.js'][70] = 0;
  _$jscoverage['middleware/urlencoded.js'][72] = 0;
  _$jscoverage['middleware/urlencoded.js'][73] = 0;
}
_$jscoverage['middleware/urlencoded.js'][13]++;
var utils = require("../utils"), _limit = require("./limit"), qs = require("qs");
_$jscoverage['middleware/urlencoded.js'][21]++;
function noop(req, res, next) {
  _$jscoverage['middleware/urlencoded.js'][22]++;
  next();
}
_$jscoverage['middleware/urlencoded.js'][40]++;
exports = module.exports = (function (options) {
  _$jscoverage['middleware/urlencoded.js'][41]++;
  options = options || {};
  _$jscoverage['middleware/urlencoded.js'][43]++;
  var limit = options.limit? _limit(options.limit): noop;
  _$jscoverage['middleware/urlencoded.js'][47]++;
  return (function urlencoded(req, res, next) {
  _$jscoverage['middleware/urlencoded.js'][48]++;
  if (req._body) {
    _$jscoverage['middleware/urlencoded.js'][48]++;
    return next();
  }
  _$jscoverage['middleware/urlencoded.js'][49]++;
  req.body = req.body || {};
  _$jscoverage['middleware/urlencoded.js'][51]++;
  if (! utils.hasBody(req)) {
    _$jscoverage['middleware/urlencoded.js'][51]++;
    return next();
  }
  _$jscoverage['middleware/urlencoded.js'][54]++;
  if ("application/x-www-form-urlencoded" != utils.mime(req)) {
    _$jscoverage['middleware/urlencoded.js'][54]++;
    return next();
  }
  _$jscoverage['middleware/urlencoded.js'][57]++;
  req._body = true;
  _$jscoverage['middleware/urlencoded.js'][60]++;
  limit(req, res, (function (err) {
  _$jscoverage['middleware/urlencoded.js'][61]++;
  if (err) {
    _$jscoverage['middleware/urlencoded.js'][61]++;
    return next(err);
  }
  _$jscoverage['middleware/urlencoded.js'][62]++;
  var buf = "";
  _$jscoverage['middleware/urlencoded.js'][63]++;
  req.setEncoding("utf8");
  _$jscoverage['middleware/urlencoded.js'][64]++;
  req.on("data", (function (chunk) {
  _$jscoverage['middleware/urlencoded.js'][64]++;
  buf += chunk;
}));
  _$jscoverage['middleware/urlencoded.js'][65]++;
  req.on("end", (function () {
  _$jscoverage['middleware/urlencoded.js'][66]++;
  try {
    _$jscoverage['middleware/urlencoded.js'][67]++;
    req.body = buf.length? qs.parse(buf, options): {};
    _$jscoverage['middleware/urlencoded.js'][70]++;
    next();
  }
  catch (err) {
    _$jscoverage['middleware/urlencoded.js'][72]++;
    err.body = buf;
    _$jscoverage['middleware/urlencoded.js'][73]++;
    next(err);
  }
}));
}));
});
});
_$jscoverage['middleware/urlencoded.js'].source = ["","/*!"," * Connect - urlencoded"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var utils = require('../utils')","  , _limit = require('./limit')","  , qs = require('qs');","","/**"," * noop middleware."," */","","function noop(req, res, next) {","  next();","}","","/**"," * Urlencoded:"," * "," *  Parse x-ww-form-urlencoded request bodies,"," *  providing the parsed object as `req.body`."," *"," * Options:"," *"," *    - `limit`  byte limit disabled by default"," *"," * @param {Object} options"," * @return {Function}"," * @api public"," */","","exports = module.exports = function(options){","  options = options || {};","","  var limit = options.limit","    ? _limit(options.limit)","    : noop;","","  return function urlencoded(req, res, next) {","    if (req._body) return next();","    req.body = req.body || {};","","    if (!utils.hasBody(req)) return next();","","    // check Content-Type","    if ('application/x-www-form-urlencoded' != utils.mime(req)) return next();","","    // flag as parsed","    req._body = true;","","    // parse","    limit(req, res, function(err){","      if (err) return next(err);","      var buf = '';","      req.setEncoding('utf8');","      req.on('data', function(chunk){ buf += chunk });","      req.on('end', function(){","        try {","          req.body = buf.length","            ? qs.parse(buf, options)","            : {};","          next();","        } catch (err){","          err.body = buf;","          next(err);","        }","      });","    });","  }","};"];
