Skip to content
Myr

return actual booleans from req.accept* functions

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

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 8ab4408 · Browse files · 1 file+3 added−3 removed
This commit

State

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

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:lib/request.js+3 added-3 removed
108 unmodified lines
109 * @api public110 */111112req.acceptsEncoding = function(encoding){113 return ~this.acceptedEncodings.indexOf(encoding);113 return !! ~this.acceptedEncodings.indexOf(encoding);114};115116/**117 * Check if the given `charset` is acceptable,
6 unmodified lines
124125req.acceptsCharset = function(charset){126 var accepted = this.acceptedCharsets;127 return accepted.length128 ? ~accepted.indexOf(charset)128 ? !! ~accepted.indexOf(charset)129 : true;130};131132/**
7 unmodified lines
140141req.acceptsLanguage = function(lang){142 var accepted = this.acceptedLanguages;143 return accepted.length144 ? ~accepted.indexOf(lang)144 ? !! ~accepted.indexOf(lang)145 : true;146};147148/**
378 unmodified lines