Skip to content
Myr

GET / HEAD only for req.fresh

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 1e09b54 · Browse files · 1 file+4 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

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:lib/request.js+4 added
388 unmodified lines
389 * @api public390 */391392req.__defineGetter__('fresh', function(){393 var method = this.method;394 var s = this.res.statusCode;395396 // GET or HEAD for weak freshness validation only397 if ('GET' != method && 'HEAD' != method) return false;398399 // 2xx or 304 as per rfc2616 14.26400 if ((s >= 200 && s < 300) || 304 == s) {401 return fresh(this.headers, this.res._headers);402 }
28 unmodified lines