Skip to content
Myr

docs: update the req.range jsdoc comment

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 7ee41cc · Browse files · 1 file+14 added−14 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+14 added−14 removed

  • other:+14 added−14 removed

1 file+14 added−14 removed

modified:lib/request.js+14 added-14 removed
169 unmodified lines
170req.acceptsLanguage = deprecate.function(req.acceptsLanguages,171 'req.acceptsLanguage: Use acceptsLanguages instead');172173/**174 * Parse Range header field,175 * capping to the given `size`.174 * Parse Range header field, capping to the given `size`.175 *177 * Unspecified ranges such as "0-" require178 * knowledge of your resource length. In179 * the case of a byte range this is of course180 * the total number of bytes. If the Range181 * header field is not given `null` is returned,182 * `-1` when unsatisfiable, `-2` when syntactically invalid.176 * Unspecified ranges such as "0-" require knowledge of your resource length. In177 * the case of a byte range this is of course the total number of bytes. If the178 * Range header field is not given `undefined` is returned, `-1` when unsatisfiable,179 * and `-2` when syntactically invalid.180 *184 * NOTE: remember that ranges are inclusive, so185 * for example "Range: users=0-3" should respond186 * with 4 users when available, not 3.181 * When ranges are returned, the array has a "type" property which is the type of182 * range that is required (most commonly, "bytes"). Each array element is an object183 * with a "start" and "end" property for the portion of the range.184 *185 * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3"186 * should respond with 4 users when available, not 3.187 *188 * @param {Number} size189 * @return {Array}188 * @param {number} size189 * @return {number|array}190 * @public191 */192193req.range = function(size){193req.range = function range(size) {194 var range = this.get('Range');195 if (!range) return;196 return parseRange(size, range);197};
292 unmodified lines