Skip to content
Myr

Added res.send(bool) support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

application/json

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent c1b72ac · Browse files · 2 files+11 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−1 removed

  • tests:+10 added−1 removed
  • other:+1 added−0 removed

2 files+11 added−1 removed

modified:lib/response.js+1 added
65 unmodified lines
66 this.charset = this.charset || 'utf-8';67 this.contentType('.html');68 }69 break;70 case 'boolean':71 case 'object':72 if (Buffer.isBuffer(body)) {73 if (!this.header('Content-Type')) {74 this.contentType('.bin');
331 unmodified lines
modified:test/response.test.js+10 added-1 removed
47 unmodified lines
48 49 app.get('/noargs', function(req, res, next){50 res.send();51 });52 52 53 app.get('/bool', function(req, res, next){54 res.send(true);55 });5657 assert.response(app,58 { url: '/bool' },59 { body: 'true'60 , headers: { 'Content-Type': 'application/json' }});6162 assert.response(app,63 { url: '/html' },64 { body: '<p>test</p>'65 , headers: {66 'Content-Language': 'en'
530 unmodified lines