Permalink
Browse files

.contentType -> .type() in core

  • Loading branch information...
1 parent 67ddb42 commit 7c2e1ad0ed218fd4aae14a6dc2df56e61cecf13f @tj tj committed Apr 26, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/response.js
View
@@ -77,23 +77,23 @@ res.send = function(body){
switch (typeof body) {
// response status
case 'number':
- this.get('Content-Type') || this.contentType('.txt');
+ 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.contentType('.html');
+ this.type('html');
}
break;
case 'boolean':
case 'object':
if (null == body) {
body = '';
} else if (Buffer.isBuffer(body)) {
- this.get('Content-Type') || this.contentType('.bin');
+ this.get('Content-Type') || this.type('bin');
} else {
return this.json(body);
}

0 comments on commit 7c2e1ad

Please sign in to comment.