Skip to content

Commit

Permalink
Attend to a couple of other spots in VR interpreter where content-typ…
Browse files Browse the repository at this point in the history
…e ought to be sent for consistency.
  • Loading branch information
mikermcneil committed Mar 20, 2017
1 parent f9a8b85 commit 542a0b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/router/res.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ module.exports = function _buildResponse (req, _res) {
throw new Error('Cannot call res.render() - `req._sails.renderView` was not attached (perhaps `views` hook is not enabled?)');
}

res.set('content-type', 'text/html');

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TODO:
// Instead of this shim, turn `sails.renderView` into something like
Expand Down Expand Up @@ -366,6 +368,9 @@ module.exports = function _buildResponse (req, _res) {
throw new Error('The 2-ary usage of `res.redirect()` is no longer supported in Express 4/Sails v1. Please use `res.status(statusCode).redirect(address)` instead.');
}

// For familiarity, set content-type header:
res.set('content-type', 'text/html');

// Set location header
res.set('Location', address);

Expand Down

0 comments on commit 542a0b3

Please sign in to comment.