Skip to content
Myr

docs

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 2e324cc · Browse files · 1 file+20 added−20 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+20 added−20 removed

  • other:+20 added−20 removed

1 file+20 added−20 removed

modified:lib/request.js+20 added-20 removed
148 unmodified lines
149 * with 4 users when available, not 3.150 *151 * Examples:152 *153 * app.get('/users', function(req, res){154 * var range = req.range(users.length);155 * 156 * switch (range) {157 * // unsatifiable158 * case -1:159 * return res.send(416);160 * // invalid or no Range161 * case -2: 162 * case undefined:163 * return res.send(users);164 * // inclusive Range165 * default:166 * if ('users' != range.type) return res.send(416);167 * range = range.shift();168 * res.status(206); // partial content169 * res.set('Content-Range', 'users ' + range.start + '-' + range.end + '/' + users.length);170 * res.send(users.slice(range.start, ++range.end));171 * }172 * });153 * app.get('/users', function(req, res){154 * var range = req.range(users.length);155 * 156 * switch (range) {157 * // unsatifiable158 * case -1:159 * return res.send(416);160 * // invalid or no Range161 * case -2: 162 * case undefined:163 * return res.send(users);164 * // inclusive Range165 * default:166 * if ('users' != range.type) return res.send(416);167 * range = range.shift();168 * res.status(206); // partial content169 * res.set('Content-Range', 'users ' + range.start + '-' + range.end + '/' + users.length);170 * res.send(users.slice(range.start, ++range.end));171 * }172 * });173 *174 * @param {Number} size175 * @return {Array}176 * @api public
304 unmodified lines