diff --git a/lib/response.js b/lib/response.js index 6781dad1ae..d65ef57622 100644 --- a/lib/response.js +++ b/lib/response.js @@ -14,6 +14,7 @@ var fs = require('fs') , path = require('path') , connect = require('connect') , utils = connect.utils + , statusCodes = http.STATUS_CODES , parseRange = require('./utils').parseRange , res = http.ServerResponse.prototype , send = connect.static.send @@ -392,10 +393,10 @@ res.redirect = function(url, status){ // Support text/{plain,html} by default if (req.accepts('html')) { - body = '

' + http.STATUS_CODES[status] + '. Redirecting to ' + url + '

'; + body = '

' + statusCodes[status] + '. Redirecting to ' + url + '

'; this.header('Content-Type', 'text/html'); } else { - body = http.STATUS_CODES[status] + '. Redirecting to ' + url; + body = statusCodes[status] + '. Redirecting to ' + url; this.header('Content-Type', 'text/plain'); }