Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/hooks/request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ module.exports = function (sails) {
*/

function _mixinReqQualifiers (req,res) {
var accept = req.get('Accept') || '';

// Flag indicating whether HTML was explicitly mentioned in the Accepts header
req.explicitlyAcceptsHTML = (req.get('Accept').indexOf('html') !== -1);
req.explicitlyAcceptsHTML = (accept.indexOf('html') !== -1);

// Flag indicating whether a request would like to receive a JSON response
req.wantsJSON = req.xhr;
Expand Down