Skip to content
Myr

add req.acceptedEncodings

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 776ee26 · Browse files · 2 files+54 added−0 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+54 added−0 removed

  • tests:+36 added−0 removed
  • other:+18 added−0 removed

2 files+54 added−0 removed

modified:lib/request.js+18 added
158 unmodified lines
159 return parseRange(size, range);160};161162/**163 * Return an array of encodings.164 *165 * Examples:166 *167 * ['gzip', 'deflate']168 *169 * @return {Array}170 * @api public171 */172173req.__defineGetter__('acceptedEncodings', function(){174 var accept = this.get('Accept-Encoding');175 return accept176 ? accept.trim().split(/ *, */)177 : [];178});179180/**181 * Return an array of Accepted media types182 * ordered from highest quality to lowest.183 *184 * Examples:
330 unmodified lines
added:test/req.acceptedEncodings.js+36 added