Skip to content
Myr

Added `fresh` dep

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 76aa718 · Browse files · 2 files+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

2 files+4 added−2 removed

modified:lib/request.js+3 added-2 removed
4 unmodified lines
56var http = require('http')7 , utils = require('./utils')8 , connect = require('connect')9 , fresh = require('fresh')10 , parse = connect.utils.parseUrl11 , mime = connect.mime;1213/**
375 unmodified lines
389 * @api public390 */391392req.__defineGetter__('fresh', function(){392 return ! this.stale;393 return fresh(this.headers, this.res._headers);394});395396/**397 * Check if the request is stale, aka
4 unmodified lines
402 * @api public403 */404405req.__defineGetter__('stale', function(){405 return connect.utils.modified(this, this.res);406 return !this.fresh;407});408409/**410 * Check if the request was an _XMLHttpRequest_.
9 unmodified lines
modified:package.json+1 added