/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['express 3.0.6/response.js']) {
  _$jscoverage['express 3.0.6/response.js'] = [];
  _$jscoverage['express 3.0.6/response.js'][5] = 0;
  _$jscoverage['express 3.0.6/response.js'][25] = 0;
  _$jscoverage['express 3.0.6/response.js'][37] = 0;
  _$jscoverage['express 3.0.6/response.js'][38] = 0;
  _$jscoverage['express 3.0.6/response.js'][39] = 0;
  _$jscoverage['express 3.0.6/response.js'][57] = 0;
  _$jscoverage['express 3.0.6/response.js'][58] = 0;
  _$jscoverage['express 3.0.6/response.js'][59] = 0;
  _$jscoverage['express 3.0.6/response.js'][80] = 0;
  _$jscoverage['express 3.0.6/response.js'][81] = 0;
  _$jscoverage['express 3.0.6/response.js'][86] = 0;
  _$jscoverage['express 3.0.6/response.js'][88] = 0;
  _$jscoverage['express 3.0.6/response.js'][89] = 0;
  _$jscoverage['express 3.0.6/response.js'][91] = 0;
  _$jscoverage['express 3.0.6/response.js'][92] = 0;
  _$jscoverage['express 3.0.6/response.js'][96] = 0;
  _$jscoverage['express 3.0.6/response.js'][99] = 0;
  _$jscoverage['express 3.0.6/response.js'][100] = 0;
  _$jscoverage['express 3.0.6/response.js'][101] = 0;
  _$jscoverage['express 3.0.6/response.js'][102] = 0;
  _$jscoverage['express 3.0.6/response.js'][105] = 0;
  _$jscoverage['express 3.0.6/response.js'][106] = 0;
  _$jscoverage['express 3.0.6/response.js'][107] = 0;
  _$jscoverage['express 3.0.6/response.js'][109] = 0;
  _$jscoverage['express 3.0.6/response.js'][112] = 0;
  _$jscoverage['express 3.0.6/response.js'][113] = 0;
  _$jscoverage['express 3.0.6/response.js'][114] = 0;
  _$jscoverage['express 3.0.6/response.js'][115] = 0;
  _$jscoverage['express 3.0.6/response.js'][117] = 0;
  _$jscoverage['express 3.0.6/response.js'][119] = 0;
  _$jscoverage['express 3.0.6/response.js'][123] = 0;
  _$jscoverage['express 3.0.6/response.js'][124] = 0;
  _$jscoverage['express 3.0.6/response.js'][131] = 0;
  _$jscoverage['express 3.0.6/response.js'][132] = 0;
  _$jscoverage['express 3.0.6/response.js'][133] = 0;
  _$jscoverage['express 3.0.6/response.js'][138] = 0;
  _$jscoverage['express 3.0.6/response.js'][141] = 0;
  _$jscoverage['express 3.0.6/response.js'][142] = 0;
  _$jscoverage['express 3.0.6/response.js'][143] = 0;
  _$jscoverage['express 3.0.6/response.js'][144] = 0;
  _$jscoverage['express 3.0.6/response.js'][145] = 0;
  _$jscoverage['express 3.0.6/response.js'][149] = 0;
  _$jscoverage['express 3.0.6/response.js'][150] = 0;
  _$jscoverage['express 3.0.6/response.js'][169] = 0;
  _$jscoverage['express 3.0.6/response.js'][171] = 0;
  _$jscoverage['express 3.0.6/response.js'][173] = 0;
  _$jscoverage['express 3.0.6/response.js'][174] = 0;
  _$jscoverage['express 3.0.6/response.js'][176] = 0;
  _$jscoverage['express 3.0.6/response.js'][177] = 0;
  _$jscoverage['express 3.0.6/response.js'][182] = 0;
  _$jscoverage['express 3.0.6/response.js'][183] = 0;
  _$jscoverage['express 3.0.6/response.js'][184] = 0;
  _$jscoverage['express 3.0.6/response.js'][185] = 0;
  _$jscoverage['express 3.0.6/response.js'][188] = 0;
  _$jscoverage['express 3.0.6/response.js'][189] = 0;
  _$jscoverage['express 3.0.6/response.js'][191] = 0;
  _$jscoverage['express 3.0.6/response.js'][210] = 0;
  _$jscoverage['express 3.0.6/response.js'][212] = 0;
  _$jscoverage['express 3.0.6/response.js'][214] = 0;
  _$jscoverage['express 3.0.6/response.js'][215] = 0;
  _$jscoverage['express 3.0.6/response.js'][217] = 0;
  _$jscoverage['express 3.0.6/response.js'][218] = 0;
  _$jscoverage['express 3.0.6/response.js'][223] = 0;
  _$jscoverage['express 3.0.6/response.js'][224] = 0;
  _$jscoverage['express 3.0.6/response.js'][225] = 0;
  _$jscoverage['express 3.0.6/response.js'][226] = 0;
  _$jscoverage['express 3.0.6/response.js'][229] = 0;
  _$jscoverage['express 3.0.6/response.js'][232] = 0;
  _$jscoverage['express 3.0.6/response.js'][233] = 0;
  _$jscoverage['express 3.0.6/response.js'][236] = 0;
  _$jscoverage['express 3.0.6/response.js'][237] = 0;
  _$jscoverage['express 3.0.6/response.js'][238] = 0;
  _$jscoverage['express 3.0.6/response.js'][239] = 0;
  _$jscoverage['express 3.0.6/response.js'][242] = 0;
  _$jscoverage['express 3.0.6/response.js'][285] = 0;
  _$jscoverage['express 3.0.6/response.js'][286] = 0;
  _$jscoverage['express 3.0.6/response.js'][293] = 0;
  _$jscoverage['express 3.0.6/response.js'][294] = 0;
  _$jscoverage['express 3.0.6/response.js'][295] = 0;
  _$jscoverage['express 3.0.6/response.js'][299] = 0;
  _$jscoverage['express 3.0.6/response.js'][302] = 0;
  _$jscoverage['express 3.0.6/response.js'][303] = 0;
  _$jscoverage['express 3.0.6/response.js'][304] = 0;
  _$jscoverage['express 3.0.6/response.js'][307] = 0;
  _$jscoverage['express 3.0.6/response.js'][308] = 0;
  _$jscoverage['express 3.0.6/response.js'][311] = 0;
  _$jscoverage['express 3.0.6/response.js'][314] = 0;
  _$jscoverage['express 3.0.6/response.js'][317] = 0;
  _$jscoverage['express 3.0.6/response.js'][321] = 0;
  _$jscoverage['express 3.0.6/response.js'][322] = 0;
  _$jscoverage['express 3.0.6/response.js'][323] = 0;
  _$jscoverage['express 3.0.6/response.js'][324] = 0;
  _$jscoverage['express 3.0.6/response.js'][328] = 0;
  _$jscoverage['express 3.0.6/response.js'][329] = 0;
  _$jscoverage['express 3.0.6/response.js'][333] = 0;
  _$jscoverage['express 3.0.6/response.js'][334] = 0;
  _$jscoverage['express 3.0.6/response.js'][335] = 0;
  _$jscoverage['express 3.0.6/response.js'][336] = 0;
  _$jscoverage['express 3.0.6/response.js'][337] = 0;
  _$jscoverage['express 3.0.6/response.js'][338] = 0;
  _$jscoverage['express 3.0.6/response.js'][339] = 0;
  _$jscoverage['express 3.0.6/response.js'][340] = 0;
  _$jscoverage['express 3.0.6/response.js'][359] = 0;
  _$jscoverage['express 3.0.6/response.js'][361] = 0;
  _$jscoverage['express 3.0.6/response.js'][362] = 0;
  _$jscoverage['express 3.0.6/response.js'][363] = 0;
  _$jscoverage['express 3.0.6/response.js'][366] = 0;
  _$jscoverage['express 3.0.6/response.js'][367] = 0;
  _$jscoverage['express 3.0.6/response.js'][368] = 0;
  _$jscoverage['express 3.0.6/response.js'][388] = 0;
  _$jscoverage['express 3.0.6/response.js'][390] = 0;
  _$jscoverage['express 3.0.6/response.js'][452] = 0;
  _$jscoverage['express 3.0.6/response.js'][453] = 0;
  _$jscoverage['express 3.0.6/response.js'][456] = 0;
  _$jscoverage['express 3.0.6/response.js'][457] = 0;
  _$jscoverage['express 3.0.6/response.js'][458] = 0;
  _$jscoverage['express 3.0.6/response.js'][460] = 0;
  _$jscoverage['express 3.0.6/response.js'][462] = 0;
  _$jscoverage['express 3.0.6/response.js'][464] = 0;
  _$jscoverage['express 3.0.6/response.js'][465] = 0;
  _$jscoverage['express 3.0.6/response.js'][466] = 0;
  _$jscoverage['express 3.0.6/response.js'][467] = 0;
  _$jscoverage['express 3.0.6/response.js'][468] = 0;
  _$jscoverage['express 3.0.6/response.js'][470] = 0;
  _$jscoverage['express 3.0.6/response.js'][471] = 0;
  _$jscoverage['express 3.0.6/response.js'][472] = 0;
  _$jscoverage['express 3.0.6/response.js'][473] = 0;
  _$jscoverage['express 3.0.6/response.js'][476] = 0;
  _$jscoverage['express 3.0.6/response.js'][487] = 0;
  _$jscoverage['express 3.0.6/response.js'][488] = 0;
  _$jscoverage['express 3.0.6/response.js'][489] = 0;
  _$jscoverage['express 3.0.6/response.js'][492] = 0;
  _$jscoverage['express 3.0.6/response.js'][512] = 0;
  _$jscoverage['express 3.0.6/response.js'][514] = 0;
  _$jscoverage['express 3.0.6/response.js'][515] = 0;
  _$jscoverage['express 3.0.6/response.js'][517] = 0;
  _$jscoverage['express 3.0.6/response.js'][518] = 0;
  _$jscoverage['express 3.0.6/response.js'][521] = 0;
  _$jscoverage['express 3.0.6/response.js'][532] = 0;
  _$jscoverage['express 3.0.6/response.js'][533] = 0;
  _$jscoverage['express 3.0.6/response.js'][545] = 0;
  _$jscoverage['express 3.0.6/response.js'][546] = 0;
  _$jscoverage['express 3.0.6/response.js'][547] = 0;
  _$jscoverage['express 3.0.6/response.js'][575] = 0;
  _$jscoverage['express 3.0.6/response.js'][576] = 0;
  _$jscoverage['express 3.0.6/response.js'][577] = 0;
  _$jscoverage['express 3.0.6/response.js'][578] = 0;
  _$jscoverage['express 3.0.6/response.js'][579] = 0;
  _$jscoverage['express 3.0.6/response.js'][580] = 0;
  _$jscoverage['express 3.0.6/response.js'][581] = 0;
  _$jscoverage['express 3.0.6/response.js'][582] = 0;
  _$jscoverage['express 3.0.6/response.js'][583] = 0;
  _$jscoverage['express 3.0.6/response.js'][584] = 0;
  _$jscoverage['express 3.0.6/response.js'][586] = 0;
  _$jscoverage['express 3.0.6/response.js'][587] = 0;
  _$jscoverage['express 3.0.6/response.js'][588] = 0;
  _$jscoverage['express 3.0.6/response.js'][625] = 0;
  _$jscoverage['express 3.0.6/response.js'][626] = 0;
  _$jscoverage['express 3.0.6/response.js'][633] = 0;
  _$jscoverage['express 3.0.6/response.js'][634] = 0;
  _$jscoverage['express 3.0.6/response.js'][635] = 0;
  _$jscoverage['express 3.0.6/response.js'][636] = 0;
  _$jscoverage['express 3.0.6/response.js'][638] = 0;
  _$jscoverage['express 3.0.6/response.js'][643] = 0;
  _$jscoverage['express 3.0.6/response.js'][646] = 0;
  _$jscoverage['express 3.0.6/response.js'][649] = 0;
  _$jscoverage['express 3.0.6/response.js'][650] = 0;
  _$jscoverage['express 3.0.6/response.js'][653] = 0;
  _$jscoverage['express 3.0.6/response.js'][654] = 0;
  _$jscoverage['express 3.0.6/response.js'][656] = 0;
  _$jscoverage['express 3.0.6/response.js'][657] = 0;
  _$jscoverage['express 3.0.6/response.js'][662] = 0;
  _$jscoverage['express 3.0.6/response.js'][664] = 0;
  _$jscoverage['express 3.0.6/response.js'][668] = 0;
  _$jscoverage['express 3.0.6/response.js'][669] = 0;
  _$jscoverage['express 3.0.6/response.js'][673] = 0;
  _$jscoverage['express 3.0.6/response.js'][678] = 0;
  _$jscoverage['express 3.0.6/response.js'][679] = 0;
  _$jscoverage['express 3.0.6/response.js'][680] = 0;
  _$jscoverage['express 3.0.6/response.js'][681] = 0;
  _$jscoverage['express 3.0.6/response.js'][700] = 0;
  _$jscoverage['express 3.0.6/response.js'][701] = 0;
  _$jscoverage['express 3.0.6/response.js'][707] = 0;
  _$jscoverage['express 3.0.6/response.js'][708] = 0;
  _$jscoverage['express 3.0.6/response.js'][712] = 0;
  _$jscoverage['express 3.0.6/response.js'][715] = 0;
  _$jscoverage['express 3.0.6/response.js'][716] = 0;
  _$jscoverage['express 3.0.6/response.js'][717] = 0;
  _$jscoverage['express 3.0.6/response.js'][721] = 0;
}
_$jscoverage['express 3.0.6/response.js'][5]++;
var http = require("http"), path = require("path"), connect = require("connect"), utils = connect.utils, sign = require("cookie-signature").sign, normalizeType = require("./utils").normalizeType, normalizeTypes = require("./utils").normalizeTypes, etag = require("./utils").etag, statusCodes = http.STATUS_CODES, cookie = require("cookie"), send = require("send"), mime = connect.mime, basename = path.basename, extname = path.extname, join = path.join;
_$jscoverage['express 3.0.6/response.js'][25]++;
var res = module.exports = {__proto__: http.ServerResponse.prototype};
_$jscoverage['express 3.0.6/response.js'][37]++;
res.status = (function (code) {
  _$jscoverage['express 3.0.6/response.js'][38]++;
  this.statusCode = code;
  _$jscoverage['express 3.0.6/response.js'][39]++;
  return this;
});
_$jscoverage['express 3.0.6/response.js'][57]++;
res.links = (function (links) {
  _$jscoverage['express 3.0.6/response.js'][58]++;
  return this.set("Link", Object.keys(links).map((function (rel) {
  _$jscoverage['express 3.0.6/response.js'][59]++;
  return "<" + links[rel] + ">; rel=\"" + rel + "\"";
})).join(", "));
});
_$jscoverage['express 3.0.6/response.js'][80]++;
res.send = (function (body) {
  _$jscoverage['express 3.0.6/response.js'][81]++;
  var req = this.req, head = "HEAD" == req.method, len;
  _$jscoverage['express 3.0.6/response.js'][86]++;
  if (2 == arguments.length) {
    _$jscoverage['express 3.0.6/response.js'][88]++;
    if ("number" != typeof body && "number" == typeof arguments[1]) {
      _$jscoverage['express 3.0.6/response.js'][89]++;
      this.statusCode = arguments[1];
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][91]++;
      this.statusCode = body;
      _$jscoverage['express 3.0.6/response.js'][92]++;
      body = arguments[1];
    }
  }
  _$jscoverage['express 3.0.6/response.js'][96]++;
  switch (typeof body) {
  case "number":
    _$jscoverage['express 3.0.6/response.js'][99]++;
    this.get("Content-Type") || this.type("txt");
    _$jscoverage['express 3.0.6/response.js'][100]++;
    this.statusCode = body;
    _$jscoverage['express 3.0.6/response.js'][101]++;
    body = http.STATUS_CODES[body];
    _$jscoverage['express 3.0.6/response.js'][102]++;
    break;
  case "string":
    _$jscoverage['express 3.0.6/response.js'][105]++;
    if (! this.get("Content-Type")) {
      _$jscoverage['express 3.0.6/response.js'][106]++;
      this.charset = this.charset || "utf-8";
      _$jscoverage['express 3.0.6/response.js'][107]++;
      this.type("html");
    }
    _$jscoverage['express 3.0.6/response.js'][109]++;
    break;
  case "boolean":
  case "object":
    _$jscoverage['express 3.0.6/response.js'][112]++;
    if (null == body) {
      _$jscoverage['express 3.0.6/response.js'][113]++;
      body = "";
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][114]++;
      if (Buffer.isBuffer(body)) {
        _$jscoverage['express 3.0.6/response.js'][115]++;
        this.get("Content-Type") || this.type("bin");
      }
      else {
        _$jscoverage['express 3.0.6/response.js'][117]++;
        return this.json(body);
      }
    }
    _$jscoverage['express 3.0.6/response.js'][119]++;
    break;
  }
  _$jscoverage['express 3.0.6/response.js'][123]++;
  if (undefined !== body && ! this.get("Content-Length")) {
    _$jscoverage['express 3.0.6/response.js'][124]++;
    this.set("Content-Length", len = Buffer.isBuffer(body)? body.length: Buffer.byteLength(body));
  }
  _$jscoverage['express 3.0.6/response.js'][131]++;
  if (len > 1024) {
    _$jscoverage['express 3.0.6/response.js'][132]++;
    if (! this.get("ETag")) {
      _$jscoverage['express 3.0.6/response.js'][133]++;
      this.set("ETag", etag(body));
    }
  }
  _$jscoverage['express 3.0.6/response.js'][138]++;
  if (req.fresh) {
    _$jscoverage['express 3.0.6/response.js'][138]++;
    this.statusCode = 304;
  }
  _$jscoverage['express 3.0.6/response.js'][141]++;
  if (204 == this.statusCode || 304 == this.statusCode) {
    _$jscoverage['express 3.0.6/response.js'][142]++;
    this.removeHeader("Content-Type");
    _$jscoverage['express 3.0.6/response.js'][143]++;
    this.removeHeader("Content-Length");
    _$jscoverage['express 3.0.6/response.js'][144]++;
    this.removeHeader("Transfer-Encoding");
    _$jscoverage['express 3.0.6/response.js'][145]++;
    body = "";
  }
  _$jscoverage['express 3.0.6/response.js'][149]++;
  this.end(head? null: body);
  _$jscoverage['express 3.0.6/response.js'][150]++;
  return this;
});
_$jscoverage['express 3.0.6/response.js'][169]++;
res.json = (function (obj) {
  _$jscoverage['express 3.0.6/response.js'][171]++;
  if (2 == arguments.length) {
    _$jscoverage['express 3.0.6/response.js'][173]++;
    if ("number" == typeof arguments[1]) {
      _$jscoverage['express 3.0.6/response.js'][174]++;
      this.statusCode = arguments[1];
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][176]++;
      this.statusCode = obj;
      _$jscoverage['express 3.0.6/response.js'][177]++;
      obj = arguments[1];
    }
  }
  _$jscoverage['express 3.0.6/response.js'][182]++;
  var app = this.app;
  _$jscoverage['express 3.0.6/response.js'][183]++;
  var replacer = app.get("json replacer");
  _$jscoverage['express 3.0.6/response.js'][184]++;
  var spaces = app.get("json spaces");
  _$jscoverage['express 3.0.6/response.js'][185]++;
  var body = JSON.stringify(obj, replacer, spaces);
  _$jscoverage['express 3.0.6/response.js'][188]++;
  this.charset = this.charset || "utf-8";
  _$jscoverage['express 3.0.6/response.js'][189]++;
  this.get("Content-Type") || this.set("Content-Type", "application/json");
  _$jscoverage['express 3.0.6/response.js'][191]++;
  return this.send(body);
});
_$jscoverage['express 3.0.6/response.js'][210]++;
res.jsonp = (function (obj) {
  _$jscoverage['express 3.0.6/response.js'][212]++;
  if (2 == arguments.length) {
    _$jscoverage['express 3.0.6/response.js'][214]++;
    if ("number" == typeof arguments[1]) {
      _$jscoverage['express 3.0.6/response.js'][215]++;
      this.statusCode = arguments[1];
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][217]++;
      this.statusCode = obj;
      _$jscoverage['express 3.0.6/response.js'][218]++;
      obj = arguments[1];
    }
  }
  _$jscoverage['express 3.0.6/response.js'][223]++;
  var app = this.app;
  _$jscoverage['express 3.0.6/response.js'][224]++;
  var replacer = app.get("json replacer");
  _$jscoverage['express 3.0.6/response.js'][225]++;
  var spaces = app.get("json spaces");
  _$jscoverage['express 3.0.6/response.js'][226]++;
  var body = JSON.stringify(obj, replacer, spaces).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
  _$jscoverage['express 3.0.6/response.js'][229]++;
  var callback = this.req.query[app.get("jsonp callback name")];
  _$jscoverage['express 3.0.6/response.js'][232]++;
  this.charset = this.charset || "utf-8";
  _$jscoverage['express 3.0.6/response.js'][233]++;
  this.set("Content-Type", "application/json");
  _$jscoverage['express 3.0.6/response.js'][236]++;
  if (callback) {
    _$jscoverage['express 3.0.6/response.js'][237]++;
    this.set("Content-Type", "text/javascript");
    _$jscoverage['express 3.0.6/response.js'][238]++;
    var cb = callback.replace(/[^\[\]\w$.]/g, "");
    _$jscoverage['express 3.0.6/response.js'][239]++;
    body = cb + " && " + cb + "(" + body + ");";
  }
  _$jscoverage['express 3.0.6/response.js'][242]++;
  return this.send(body);
});
_$jscoverage['express 3.0.6/response.js'][285]++;
res.sendfile = (function (path, options, fn) {
  _$jscoverage['express 3.0.6/response.js'][286]++;
  var self = this, req = self.req, next = this.req.next, options = options || {}, done;
  _$jscoverage['express 3.0.6/response.js'][293]++;
  if ("function" == typeof options) {
    _$jscoverage['express 3.0.6/response.js'][294]++;
    fn = options;
    _$jscoverage['express 3.0.6/response.js'][295]++;
    options = {};
  }
  _$jscoverage['express 3.0.6/response.js'][299]++;
  req.socket.on("error", error);
  _$jscoverage['express 3.0.6/response.js'][302]++;
  function error(err) {
    _$jscoverage['express 3.0.6/response.js'][303]++;
    if (done) {
      _$jscoverage['express 3.0.6/response.js'][303]++;
      return;
    }
    _$jscoverage['express 3.0.6/response.js'][304]++;
    done = true;
    _$jscoverage['express 3.0.6/response.js'][307]++;
    cleanup();
    _$jscoverage['express 3.0.6/response.js'][308]++;
    if (! self.headerSent) {
      _$jscoverage['express 3.0.6/response.js'][308]++;
      self.removeHeader("Content-Disposition");
    }
    _$jscoverage['express 3.0.6/response.js'][311]++;
    if (fn) {
      _$jscoverage['express 3.0.6/response.js'][311]++;
      return fn(err);
    }
    _$jscoverage['express 3.0.6/response.js'][314]++;
    if (self.headerSent) {
      _$jscoverage['express 3.0.6/response.js'][314]++;
      return;
    }
    _$jscoverage['express 3.0.6/response.js'][317]++;
    next(err);
}
  _$jscoverage['express 3.0.6/response.js'][321]++;
  function stream() {
    _$jscoverage['express 3.0.6/response.js'][322]++;
    if (done) {
      _$jscoverage['express 3.0.6/response.js'][322]++;
      return;
    }
    _$jscoverage['express 3.0.6/response.js'][323]++;
    cleanup();
    _$jscoverage['express 3.0.6/response.js'][324]++;
    if (fn) {
      _$jscoverage['express 3.0.6/response.js'][324]++;
      self.on("finish", fn);
    }
}
  _$jscoverage['express 3.0.6/response.js'][328]++;
  function cleanup() {
    _$jscoverage['express 3.0.6/response.js'][329]++;
    req.socket.removeListener("error", error);
}
  _$jscoverage['express 3.0.6/response.js'][333]++;
  var file = send(req, path);
  _$jscoverage['express 3.0.6/response.js'][334]++;
  if (options.root) {
    _$jscoverage['express 3.0.6/response.js'][334]++;
    file.root(options.root);
  }
  _$jscoverage['express 3.0.6/response.js'][335]++;
  file.maxage(options.maxAge || 0);
  _$jscoverage['express 3.0.6/response.js'][336]++;
  file.on("error", error);
  _$jscoverage['express 3.0.6/response.js'][337]++;
  file.on("directory", next);
  _$jscoverage['express 3.0.6/response.js'][338]++;
  file.on("stream", stream);
  _$jscoverage['express 3.0.6/response.js'][339]++;
  file.pipe(this);
  _$jscoverage['express 3.0.6/response.js'][340]++;
  this.on("finish", cleanup);
});
_$jscoverage['express 3.0.6/response.js'][359]++;
res.download = (function (path, filename, fn) {
  _$jscoverage['express 3.0.6/response.js'][361]++;
  if ("function" == typeof filename) {
    _$jscoverage['express 3.0.6/response.js'][362]++;
    fn = filename;
    _$jscoverage['express 3.0.6/response.js'][363]++;
    filename = null;
  }
  _$jscoverage['express 3.0.6/response.js'][366]++;
  filename = filename || path;
  _$jscoverage['express 3.0.6/response.js'][367]++;
  this.set("Content-Disposition", "attachment; filename=\"" + basename(filename) + "\"");
  _$jscoverage['express 3.0.6/response.js'][368]++;
  return this.sendfile(path, fn);
});
_$jscoverage['express 3.0.6/response.js'][388]++;
res.contentType = res.type = (function (type) {
  _$jscoverage['express 3.0.6/response.js'][390]++;
  return this.set("Content-Type", ~ type.indexOf("/")? type: mime.lookup(type));
});
_$jscoverage['express 3.0.6/response.js'][452]++;
res.format = (function (obj) {
  _$jscoverage['express 3.0.6/response.js'][453]++;
  var req = this.req, next = req.next;
  _$jscoverage['express 3.0.6/response.js'][456]++;
  var fn = obj["default"];
  _$jscoverage['express 3.0.6/response.js'][457]++;
  if (fn) {
    _$jscoverage['express 3.0.6/response.js'][457]++;
    delete obj["default"];
  }
  _$jscoverage['express 3.0.6/response.js'][458]++;
  var keys = Object.keys(obj);
  _$jscoverage['express 3.0.6/response.js'][460]++;
  var key = req.accepts(keys);
  _$jscoverage['express 3.0.6/response.js'][462]++;
  this.set("Vary", "Accept");
  _$jscoverage['express 3.0.6/response.js'][464]++;
  if (key) {
    _$jscoverage['express 3.0.6/response.js'][465]++;
    this.set("Content-Type", normalizeType(key));
    _$jscoverage['express 3.0.6/response.js'][466]++;
    obj[key](req, this, next);
  }
  else {
    _$jscoverage['express 3.0.6/response.js'][467]++;
    if (fn) {
      _$jscoverage['express 3.0.6/response.js'][468]++;
      fn();
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][470]++;
      var err = new Error("Not Acceptable");
      _$jscoverage['express 3.0.6/response.js'][471]++;
      err.status = 406;
      _$jscoverage['express 3.0.6/response.js'][472]++;
      err.types = normalizeTypes(keys);
      _$jscoverage['express 3.0.6/response.js'][473]++;
      next(err);
    }
  }
  _$jscoverage['express 3.0.6/response.js'][476]++;
  return this;
});
_$jscoverage['express 3.0.6/response.js'][487]++;
res.attachment = (function (filename) {
  _$jscoverage['express 3.0.6/response.js'][488]++;
  if (filename) {
    _$jscoverage['express 3.0.6/response.js'][488]++;
    this.type(extname(filename));
  }
  _$jscoverage['express 3.0.6/response.js'][489]++;
  this.set("Content-Disposition", filename? "attachment; filename=\"" + basename(filename) + "\"": "attachment");
  _$jscoverage['express 3.0.6/response.js'][492]++;
  return this;
});
_$jscoverage['express 3.0.6/response.js'][512]++;
res.set = res.header = (function (field, val) {
  _$jscoverage['express 3.0.6/response.js'][514]++;
  if (2 == arguments.length) {
    _$jscoverage['express 3.0.6/response.js'][515]++;
    this.setHeader(field, "" + val);
  }
  else {
    _$jscoverage['express 3.0.6/response.js'][517]++;
    for (var key in field) {
      _$jscoverage['express 3.0.6/response.js'][518]++;
      this.setHeader(key, "" + field[key]);
}
  }
  _$jscoverage['express 3.0.6/response.js'][521]++;
  return this;
});
_$jscoverage['express 3.0.6/response.js'][532]++;
res.get = (function (field) {
  _$jscoverage['express 3.0.6/response.js'][533]++;
  return this.getHeader(field);
});
_$jscoverage['express 3.0.6/response.js'][545]++;
res.clearCookie = (function (name, options) {
  _$jscoverage['express 3.0.6/response.js'][546]++;
  var opts = {expires: new Date(1), path: "/"};
  _$jscoverage['express 3.0.6/response.js'][547]++;
  return this.cookie(name, "", options? utils.merge(opts, options): opts);
});
_$jscoverage['express 3.0.6/response.js'][575]++;
res.cookie = (function (name, val, options) {
  _$jscoverage['express 3.0.6/response.js'][576]++;
  options = utils.merge({}, options);
  _$jscoverage['express 3.0.6/response.js'][577]++;
  var secret = this.req.secret;
  _$jscoverage['express 3.0.6/response.js'][578]++;
  var signed = options.signed;
  _$jscoverage['express 3.0.6/response.js'][579]++;
  if (signed && ! secret) {
    _$jscoverage['express 3.0.6/response.js'][579]++;
    throw new Error("connect.cookieParser(\"secret\") required for signed cookies");
  }
  _$jscoverage['express 3.0.6/response.js'][580]++;
  if ("object" == typeof val) {
    _$jscoverage['express 3.0.6/response.js'][580]++;
    val = "j:" + JSON.stringify(val);
  }
  _$jscoverage['express 3.0.6/response.js'][581]++;
  if (signed) {
    _$jscoverage['express 3.0.6/response.js'][581]++;
    val = "s:" + sign(val, secret);
  }
  _$jscoverage['express 3.0.6/response.js'][582]++;
  if ("maxAge" in options) {
    _$jscoverage['express 3.0.6/response.js'][583]++;
    options.expires = new Date(Date.now() + options.maxAge);
    _$jscoverage['express 3.0.6/response.js'][584]++;
    options.maxAge /= 1000;
  }
  _$jscoverage['express 3.0.6/response.js'][586]++;
  if (null == options.path) {
    _$jscoverage['express 3.0.6/response.js'][586]++;
    options.path = "/";
  }
  _$jscoverage['express 3.0.6/response.js'][587]++;
  this.set("Set-Cookie", cookie.serialize(name, String(val), options));
  _$jscoverage['express 3.0.6/response.js'][588]++;
  return this;
});
_$jscoverage['express 3.0.6/response.js'][625]++;
res.redirect = (function (url) {
  _$jscoverage['express 3.0.6/response.js'][626]++;
  var app = this.app, req = this.req, head = "HEAD" == req.method, status = 302, body;
  _$jscoverage['express 3.0.6/response.js'][633]++;
  if (2 == arguments.length) {
    _$jscoverage['express 3.0.6/response.js'][634]++;
    if ("number" == typeof url) {
      _$jscoverage['express 3.0.6/response.js'][635]++;
      status = url;
      _$jscoverage['express 3.0.6/response.js'][636]++;
      url = arguments[1];
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][638]++;
      status = arguments[1];
    }
  }
  _$jscoverage['express 3.0.6/response.js'][643]++;
  var map = {back: req.get("Referrer") || "/"};
  _$jscoverage['express 3.0.6/response.js'][646]++;
  url = map[url] || url;
  _$jscoverage['express 3.0.6/response.js'][649]++;
  if (! ~ url.indexOf("://") && 0 != url.indexOf("//")) {
    _$jscoverage['express 3.0.6/response.js'][650]++;
    var path = app.path();
    _$jscoverage['express 3.0.6/response.js'][653]++;
    if ("." == url[0]) {
      _$jscoverage['express 3.0.6/response.js'][654]++;
      url = req.path + "/" + url;
    }
    else {
      _$jscoverage['express 3.0.6/response.js'][656]++;
      if ("/" != url[0]) {
        _$jscoverage['express 3.0.6/response.js'][657]++;
        url = path + "/" + url;
      }
    }
  }
  _$jscoverage['express 3.0.6/response.js'][662]++;
  this.format({text: (function () {
  _$jscoverage['express 3.0.6/response.js'][664]++;
  body = statusCodes[status] + ". Redirecting to " + encodeURI(url);
}), html: (function () {
  _$jscoverage['express 3.0.6/response.js'][668]++;
  var u = utils.escape(url);
  _$jscoverage['express 3.0.6/response.js'][669]++;
  body = "<p>" + statusCodes[status] + ". Redirecting to <a href=\"" + u + "\">" + u + "</a></p>";
}), default: (function () {
  _$jscoverage['express 3.0.6/response.js'][673]++;
  body = "";
})});
  _$jscoverage['express 3.0.6/response.js'][678]++;
  this.statusCode = status;
  _$jscoverage['express 3.0.6/response.js'][679]++;
  this.set("Location", url);
  _$jscoverage['express 3.0.6/response.js'][680]++;
  this.set("Content-Length", Buffer.byteLength(body));
  _$jscoverage['express 3.0.6/response.js'][681]++;
  this.end(head? null: body);
});
_$jscoverage['express 3.0.6/response.js'][700]++;
res.render = (function (view, options, fn) {
  _$jscoverage['express 3.0.6/response.js'][701]++;
  var self = this, options = options || {}, req = this.req, app = req.app;
  _$jscoverage['express 3.0.6/response.js'][707]++;
  if ("function" == typeof options) {
    _$jscoverage['express 3.0.6/response.js'][708]++;
    fn = options, options = {};
  }
  _$jscoverage['express 3.0.6/response.js'][712]++;
  options._locals = self.locals;
  _$jscoverage['express 3.0.6/response.js'][715]++;
  fn = fn || (function (err, str) {
  _$jscoverage['express 3.0.6/response.js'][716]++;
  if (err) {
    _$jscoverage['express 3.0.6/response.js'][716]++;
    return req.next(err);
  }
  _$jscoverage['express 3.0.6/response.js'][717]++;
  self.send(str);
});
  _$jscoverage['express 3.0.6/response.js'][721]++;
  app.render(view, options, fn);
});
_$jscoverage['express 3.0.6/response.js'].source = ["/**"," * Module dependencies."," */","","var http = require('http')","  , path = require('path')","  , connect = require('connect')","  , utils = connect.utils","  , sign = require('cookie-signature').sign","  , normalizeType = require('./utils').normalizeType","  , normalizeTypes = require('./utils').normalizeTypes","  , etag = require('./utils').etag","  , statusCodes = http.STATUS_CODES","  , cookie = require('cookie')","  , send = require('send')","  , mime = connect.mime","  , basename = path.basename","  , extname = path.extname","  , join = path.join;","","/**"," * Response prototype."," */","","var res = module.exports = {","  __proto__: http.ServerResponse.prototype","};","","/**"," * Set status `code`."," *"," * @param {Number} code"," * @return {ServerResponse}"," * @api public"," */","","res.status = function(code){","  this.statusCode = code;","  return this;","};","","/**"," * Set Link header field with the given `links`."," *"," * Examples:"," *"," *    res.links({"," *      next: 'http://api.example.com/users?page=2',"," *      last: 'http://api.example.com/users?page=5'"," *    });"," *"," * @param {Object} links"," * @return {ServerResponse}"," * @api public"," */","","res.links = function(links){","  return this.set('Link', Object.keys(links).map(function(rel){","    return '&lt;' + links[rel] + '&gt;; rel=\"' + rel + '\"';","  }).join(', '));","};","","/**"," * Send a response."," *"," * Examples:"," *"," *     res.send(new Buffer('wahoo'));"," *     res.send({ some: 'json' });"," *     res.send('&lt;p&gt;some html&lt;/p&gt;');"," *     res.send(404, 'Sorry, cant find that');"," *     res.send(404);"," *"," * @param {Mixed} body or status"," * @param {Mixed} body"," * @return {ServerResponse}"," * @api public"," */","","res.send = function(body){","  var req = this.req","    , head = 'HEAD' == req.method","    , len;","","  // allow status / body","  if (2 == arguments.length) {","    // res.send(body, status) backwards compat","    if ('number' != typeof body &amp;&amp; 'number' == typeof arguments[1]) {","      this.statusCode = arguments[1];","    } else {","      this.statusCode = body;","      body = arguments[1];","    }","  }","","  switch (typeof body) {","    // response status","    case 'number':","      this.get('Content-Type') || this.type('txt');","      this.statusCode = body;","      body = http.STATUS_CODES[body];","      break;","    // string defaulting to html","    case 'string':","      if (!this.get('Content-Type')) {","        this.charset = this.charset || 'utf-8';","        this.type('html');","      }","      break;","    case 'boolean':","    case 'object':","      if (null == body) {","        body = '';","      } else if (Buffer.isBuffer(body)) {","        this.get('Content-Type') || this.type('bin');","      } else {","        return this.json(body);","      }","      break;","  }","","  // populate Content-Length","  if (undefined !== body &amp;&amp; !this.get('Content-Length')) {","    this.set('Content-Length', len = Buffer.isBuffer(body)","      ? body.length","      : Buffer.byteLength(body));","  }","","  // ETag support","  // TODO: W/ support","  if (len &gt; 1024) {","    if (!this.get('ETag')) {","      this.set('ETag', etag(body));","    }","  }","","  // freshness","  if (req.fresh) this.statusCode = 304;","","  // strip irrelevant headers","  if (204 == this.statusCode || 304 == this.statusCode) {","    this.removeHeader('Content-Type');","    this.removeHeader('Content-Length');","    this.removeHeader('Transfer-Encoding');","    body = '';","  }","","  // respond","  this.end(head ? null : body);","  return this;","};","","/**"," * Send JSON response."," *"," * Examples:"," *"," *     res.json(null);"," *     res.json({ user: 'tj' });"," *     res.json(500, 'oh noes!');"," *     res.json(404, 'I dont have that');"," *"," * @param {Mixed} obj or status"," * @param {Mixed} obj"," * @return {ServerResponse}"," * @api public"," */","","res.json = function(obj){","  // allow status / body","  if (2 == arguments.length) {","    // res.json(body, status) backwards compat","    if ('number' == typeof arguments[1]) {","      this.statusCode = arguments[1];","    } else {","      this.statusCode = obj;","      obj = arguments[1];","    }","  }","","  // settings","  var app = this.app;","  var replacer = app.get('json replacer');","  var spaces = app.get('json spaces');","  var body = JSON.stringify(obj, replacer, spaces);","","  // content-type","  this.charset = this.charset || 'utf-8';","  this.get('Content-Type') || this.set('Content-Type', 'application/json');","  ","  return this.send(body);","};","","/**"," * Send JSON response with JSONP callback support."," *"," * Examples:"," *"," *     res.jsonp(null);"," *     res.jsonp({ user: 'tj' });"," *     res.jsonp(500, 'oh noes!');"," *     res.jsonp(404, 'I dont have that');"," *"," * @param {Mixed} obj or status"," * @param {Mixed} obj"," * @return {ServerResponse}"," * @api public"," */","","res.jsonp = function(obj){","  // allow status / body","  if (2 == arguments.length) {","    // res.json(body, status) backwards compat","    if ('number' == typeof arguments[1]) {","      this.statusCode = arguments[1];","    } else {","      this.statusCode = obj;","      obj = arguments[1];","    }","  }","","  // settings","  var app = this.app;","  var replacer = app.get('json replacer');","  var spaces = app.get('json spaces');","  var body = JSON.stringify(obj, replacer, spaces)","    .replace(/\\u2028/g, '\\\\u2028')","    .replace(/\\u2029/g, '\\\\u2029');","  var callback = this.req.query[app.get('jsonp callback name')];","","  // content-type","  this.charset = this.charset || 'utf-8';","  this.set('Content-Type', 'application/json');","  ","  // jsonp","  if (callback) {","    this.set('Content-Type', 'text/javascript');","    var cb = callback.replace(/[^\\[\\]\\w$.]/g, '');","    body = cb + ' &amp;&amp; ' + cb + '(' + body + ');';","  }","","  return this.send(body);","};","","/**"," * Transfer the file at the given `path`."," * "," * Automatically sets the _Content-Type_ response header field."," * The callback `fn(err)` is invoked when the transfer is complete"," * or when an error occurs. Be sure to check `res.sentHeader`"," * if you wish to attempt responding, as the header and some data"," * may have already been transferred."," *"," * Options:"," *"," *   - `maxAge` defaulting to 0"," *   - `root`   root directory for relative filenames"," *"," * Examples:"," *"," *  The following example illustrates how `res.sendfile()` may"," *  be used as an alternative for the `static()` middleware for"," *  dynamic situations. The code backing `res.sendfile()` is actually"," *  the same code, so HTTP cache support etc is identical."," *"," *     app.get('/user/:uid/photos/:file', function(req, res){"," *       var uid = req.params.uid"," *         , file = req.params.file;"," *     "," *       req.user.mayViewFilesFrom(uid, function(yes){"," *         if (yes) {"," *           res.sendfile('/uploads/' + uid + '/' + file);"," *         } else {"," *           res.send(403, 'Sorry! you cant see that.');"," *         }"," *       });"," *     });"," *"," * @param {String} path"," * @param {Object|Function} options or fn"," * @param {Function} fn"," * @api public"," */","","res.sendfile = function(path, options, fn){","  var self = this","    , req = self.req","    , next = this.req.next","    , options = options || {}","    , done;","","  // support function as second arg","  if ('function' == typeof options) {","    fn = options;","    options = {};","  }","","  // socket errors","  req.socket.on('error', error);","","  // errors","  function error(err) {","    if (done) return;","    done = true;","","    // clean up","    cleanup();","    if (!self.headerSent) self.removeHeader('Content-Disposition');","","    // callback available","    if (fn) return fn(err);","","    // list in limbo if there's no callback","    if (self.headerSent) return;","","    // delegate","    next(err);","  }","","  // streaming","  function stream() {","    if (done) return;","    cleanup();","    if (fn) self.on('finish', fn);","  }","","  // cleanup","  function cleanup() {","    req.socket.removeListener('error', error);","  }","","  // transfer","  var file = send(req, path);","  if (options.root) file.root(options.root);","  file.maxage(options.maxAge || 0);","  file.on('error', error);","  file.on('directory', next);","  file.on('stream', stream);","  file.pipe(this);","  this.on('finish', cleanup);","};","","/**"," * Transfer the file at the given `path` as an attachment."," *"," * Optionally providing an alternate attachment `filename`,"," * and optional callback `fn(err)`. The callback is invoked"," * when the data transfer is complete, or when an error has"," * ocurred. Be sure to check `res.headerSent` if you plan to respond."," *"," * This method uses `res.sendfile()`."," *"," * @param {String} path"," * @param {String|Function} filename or fn"," * @param {Function} fn"," * @api public"," */","","res.download = function(path, filename, fn){","  // support function as second arg","  if ('function' == typeof filename) {","    fn = filename;","    filename = null;","  }","","  filename = filename || path;","  this.set('Content-Disposition', 'attachment; filename=\"' + basename(filename) + '\"');","  return this.sendfile(path, fn);","};","","/**"," * Set _Content-Type_ response header with `type` through `mime.lookup()`"," * when it does not contain \"/\", or set the Content-Type to `type` otherwise."," *"," * Examples:"," *"," *     res.type('.html');"," *     res.type('html');"," *     res.type('json');"," *     res.type('application/json');"," *     res.type('png');"," *"," * @param {String} type"," * @return {ServerResponse} for chaining"," * @api public"," */","","res.contentType =","res.type = function(type){","  return this.set('Content-Type', ~type.indexOf('/')","    ? type","    : mime.lookup(type));","};","","/**"," * Respond to the Acceptable formats using an `obj`"," * of mime-type callbacks."," *"," * This method uses `req.accepted`, an array of"," * acceptable types ordered by their quality values."," * When \"Accept\" is not present the _first_ callback"," * is invoked, otherwise the first match is used. When"," * no match is performed the server responds with"," * 406 \"Not Acceptable\"."," *"," * Content-Type is set for you, however if you choose"," * you may alter this within the callback using `res.type()`"," * or `res.set('Content-Type', ...)`."," *"," *    res.format({"," *      'text/plain': function(){"," *        res.send('hey');"," *      },"," *    "," *      'text/html': function(){"," *        res.send('&lt;p&gt;hey&lt;/p&gt;');"," *      },"," *    "," *      'appliation/json': function(){"," *        res.send({ message: 'hey' });"," *      }"," *    });"," *"," * In addition to canonicalized MIME types you may"," * also use extnames mapped to these types:"," *"," *    res.format({"," *      text: function(){"," *        res.send('hey');"," *      },"," *    "," *      html: function(){"," *        res.send('&lt;p&gt;hey&lt;/p&gt;');"," *      },"," *    "," *      json: function(){"," *        res.send({ message: 'hey' });"," *      }"," *    });"," *"," * By default Express passes an `Error`"," * with a `.status` of 406 to `next(err)`"," * if a match is not made. If you provide"," * a `.default` callback it will be invoked"," * instead."," *"," * @param {Object} obj"," * @return {ServerResponse} for chaining"," * @api public"," */","","res.format = function(obj){","  var req = this.req","    , next = req.next;","","  var fn = obj.default;","  if (fn) delete obj.default;","  var keys = Object.keys(obj);","","  var key = req.accepts(keys);","","  this.set('Vary', 'Accept');","","  if (key) {","    this.set('Content-Type', normalizeType(key));","    obj[key](req, this, next);","  } else if (fn) {","    fn();","  } else {","    var err = new Error('Not Acceptable');","    err.status = 406;","    err.types = normalizeTypes(keys);","    next(err);","  }","","  return this;","};","","/**"," * Set _Content-Disposition_ header to _attachment_ with optional `filename`."," *"," * @param {String} filename"," * @return {ServerResponse}"," * @api public"," */","","res.attachment = function(filename){","  if (filename) this.type(extname(filename));","  this.set('Content-Disposition', filename","    ? 'attachment; filename=\"' + basename(filename) + '\"'","    : 'attachment');","  return this;","};","","/**"," * Set header `field` to `val`, or pass"," * an object of header fields."," *"," * Examples:"," *"," *    res.set('Accept', 'application/json');"," *    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });"," *"," * Aliased as `res.header()`. "," *"," * @param {String|Object} field"," * @param {String} val"," * @return {ServerResponse} for chaining"," * @api public"," */","","res.set = ","res.header = function(field, val){","  if (2 == arguments.length) {","    this.setHeader(field, '' + val);","  } else {","    for (var key in field) {","      this.setHeader(key, '' + field[key]);","    }","  }","  return this;","};","","/**"," * Get value for header `field`."," *"," * @param {String} field"," * @return {String}"," * @api public"," */","","res.get = function(field){","  return this.getHeader(field);","};","","/**"," * Clear cookie `name`."," *"," * @param {String} name"," * @param {Object} options"," * @param {ServerResponse} for chaining"," * @api public"," */","","res.clearCookie = function(name, options){","  var opts = { expires: new Date(1), path: '/' };","  return this.cookie(name, '', options","    ? utils.merge(opts, options)","    : opts);","};","","/**"," * Set cookie `name` to `val`, with the given `options`."," *"," * Options:"," *"," *    - `maxAge`   max-age in milliseconds, converted to `expires`"," *    - `signed`   sign the cookie"," *    - `path`     defaults to \"/\""," *"," * Examples:"," *"," *    // \"Remember Me\" for 15 minutes"," *    res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });"," *"," *    // save as above"," *    res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })"," *"," * @param {String} name"," * @param {String|Object} val"," * @param {Options} options"," * @api public"," */","","res.cookie = function(name, val, options){","  options = utils.merge({}, options);","  var secret = this.req.secret;","  var signed = options.signed;","  if (signed &amp;&amp; !secret) throw new Error('connect.cookieParser(\"secret\") required for signed cookies');","  if ('object' == typeof val) val = 'j:' + JSON.stringify(val);","  if (signed) val = 's:' + sign(val, secret);","  if ('maxAge' in options) {","    options.expires = new Date(Date.now() + options.maxAge);","    options.maxAge /= 1000;","  }","  if (null == options.path) options.path = '/';","  this.set('Set-Cookie', cookie.serialize(name, String(val), options));","  return this;","};","","/**"," * Redirect to the given `url` with optional response `status`"," * defaulting to 302."," *"," * The given `url` can also be the name of a mapped url, for"," * example by default express supports \"back\" which redirects"," * to the _Referrer_ or _Referer_ headers or \"/\"."," *"," * Examples:"," *"," *    res.redirect('/foo/bar');"," *    res.redirect('http://example.com');"," *    res.redirect(301, 'http://example.com');"," *    res.redirect('http://example.com', 301);"," *    res.redirect('../login'); // /blog/post/1 -&gt; /blog/login"," *"," * Mounting:"," *"," *   When an application is mounted, and `res.redirect()`"," *   is given a path that does _not_ lead with \"/\". For "," *   example suppose a \"blog\" app is mounted at \"/blog\","," *   the following redirect would result in \"/blog/login\":"," *"," *      res.redirect('login');"," *"," *   While the leading slash would result in a redirect to \"/login\":"," *"," *      res.redirect('/login');"," *"," * @param {String} url"," * @param {Number} code"," * @api public"," */","","res.redirect = function(url){","  var app = this.app","    , req = this.req","    , head = 'HEAD' == req.method","    , status = 302","    , body;","","  // allow status / url","  if (2 == arguments.length) {","    if ('number' == typeof url) {","      status = url;","      url = arguments[1];","    } else {","      status = arguments[1];","    }","  }","","  // setup redirect map","  var map = { back: req.get('Referrer') || '/' };","","  // perform redirect","  url = map[url] || url;","","  // relative","  if (!~url.indexOf('://') &amp;&amp; 0 != url.indexOf('//')) {","    var path = app.path();","","    // relative to path","    if ('.' == url[0]) {","      url = req.path + '/' + url;","    // relative to mount-point","    } else if ('/' != url[0]) {","      url = path + '/' + url;","    }","  }","","  // Support text/{plain,html} by default","  this.format({","    text: function(){","      body = statusCodes[status] + '. Redirecting to ' + encodeURI(url);","    },","","    html: function(){","      var u = utils.escape(url);","      body = '&lt;p&gt;' + statusCodes[status] + '. Redirecting to &lt;a href=\"' + u + '\"&gt;' + u + '&lt;/a&gt;&lt;/p&gt;';","    },","","    default: function(){","      body = '';","    }","  });","","  // Respond","  this.statusCode = status;","  this.set('Location', url);","  this.set('Content-Length', Buffer.byteLength(body));","  this.end(head ? null : body);","};","","/**"," * Render `view` with the given `options` and optional callback `fn`."," * When a callback function is given a response will _not_ be made"," * automatically, otherwise a response of _200_ and _text/html_ is given."," *"," * Options:"," *"," *  - `cache`     boolean hinting to the engine it should cache"," *  - `filename`  filename of the view being rendered"," *"," * @param  {String} view"," * @param  {Object|Function} options or callback function"," * @param  {Function} fn"," * @api public"," */","","res.render = function(view, options, fn){","  var self = this","    , options = options || {}","    , req = this.req","    , app = req.app;","","  // support callback function as second arg","  if ('function' == typeof options) {","    fn = options, options = {};","  }","","  // merge res.locals","  options._locals = self.locals;","","  // default callback to respond","  fn = fn || function(err, str){","    if (err) return req.next(err);","    self.send(str);","  };","","  // render","  app.render(view, options, fn);","};"];
