mirror of
https://github.com/arnaucube/socketioMEANseed.git
synced 2026-02-07 03:36:47 +01:00
init
This commit is contained in:
24
server/node_modules/fresh/HISTORY.md
generated
vendored
Normal file
24
server/node_modules/fresh/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
0.2.4 / 2014-09-07
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
|
||||
0.2.3 / 2014-09-07
|
||||
==================
|
||||
|
||||
* Move repository to jshttp
|
||||
|
||||
0.2.2 / 2014-02-19
|
||||
==================
|
||||
|
||||
* Revert "Fix for blank page on Safari reload"
|
||||
|
||||
0.2.1 / 2014-01-29
|
||||
==================
|
||||
|
||||
* fix: support max-age=0 for end-to-end revalidation
|
||||
|
||||
0.2.0 / 2013-08-11
|
||||
==================
|
||||
|
||||
* fix: return false for no-cache
|
||||
22
server/node_modules/fresh/LICENSE
generated
vendored
Normal file
22
server/node_modules/fresh/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
58
server/node_modules/fresh/README.md
generated
vendored
Normal file
58
server/node_modules/fresh/README.md
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# fresh
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
HTTP response freshness testing
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ npm install fresh
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var fresh = require('fresh')
|
||||
```
|
||||
|
||||
### fresh(req, res)
|
||||
|
||||
Check freshness of `req` and `res` headers.
|
||||
|
||||
When the cache is "fresh" __true__ is returned,
|
||||
otherwise __false__ is returned to indicate that
|
||||
the cache is now stale.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var req = { 'if-none-match': 'tobi' };
|
||||
var res = { 'etag': 'luna' };
|
||||
fresh(req, res);
|
||||
// => false
|
||||
|
||||
var req = { 'if-none-match': 'tobi' };
|
||||
var res = { 'etag': 'tobi' };
|
||||
fresh(req, res);
|
||||
// => true
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/fresh.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/fresh
|
||||
[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat
|
||||
[node-version-url]: http://nodejs.org/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/fresh.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/jshttp/fresh
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/fresh.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/fresh
|
||||
53
server/node_modules/fresh/index.js
generated
vendored
Normal file
53
server/node_modules/fresh/index.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
/**
|
||||
* Expose `fresh()`.
|
||||
*/
|
||||
|
||||
module.exports = fresh;
|
||||
|
||||
/**
|
||||
* Check freshness of `req` and `res` headers.
|
||||
*
|
||||
* When the cache is "fresh" __true__ is returned,
|
||||
* otherwise __false__ is returned to indicate that
|
||||
* the cache is now stale.
|
||||
*
|
||||
* @param {Object} req
|
||||
* @param {Object} res
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function fresh(req, res) {
|
||||
// defaults
|
||||
var etagMatches = true;
|
||||
var notModified = true;
|
||||
|
||||
// fields
|
||||
var modifiedSince = req['if-modified-since'];
|
||||
var noneMatch = req['if-none-match'];
|
||||
var lastModified = res['last-modified'];
|
||||
var etag = res['etag'];
|
||||
var cc = req['cache-control'];
|
||||
|
||||
// unconditional request
|
||||
if (!modifiedSince && !noneMatch) return false;
|
||||
|
||||
// check for no-cache cache request directive
|
||||
if (cc && cc.indexOf('no-cache') !== -1) return false;
|
||||
|
||||
// parse if-none-match
|
||||
if (noneMatch) noneMatch = noneMatch.split(/ *, */);
|
||||
|
||||
// if-none-match
|
||||
if (noneMatch) etagMatches = ~noneMatch.indexOf(etag) || '*' == noneMatch[0];
|
||||
|
||||
// if-modified-since
|
||||
if (modifiedSince) {
|
||||
modifiedSince = new Date(modifiedSince);
|
||||
lastModified = new Date(lastModified);
|
||||
notModified = lastModified <= modifiedSince;
|
||||
}
|
||||
|
||||
return !! (etagMatches && notModified);
|
||||
}
|
||||
112
server/node_modules/fresh/package.json
generated
vendored
Normal file
112
server/node_modules/fresh/package.json
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "fresh@0.2.4",
|
||||
"scope": null,
|
||||
"escapedName": "fresh",
|
||||
"name": "fresh",
|
||||
"rawSpec": "0.2.4",
|
||||
"spec": "0.2.4",
|
||||
"type": "version"
|
||||
},
|
||||
"/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express"
|
||||
]
|
||||
],
|
||||
"_from": "fresh@0.2.4",
|
||||
"_id": "fresh@0.2.4",
|
||||
"_inCache": true,
|
||||
"_location": "/fresh",
|
||||
"_npmUser": {
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
"_npmVersion": "1.4.21",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "fresh@0.2.4",
|
||||
"scope": null,
|
||||
"escapedName": "fresh",
|
||||
"name": "fresh",
|
||||
"rawSpec": "0.2.4",
|
||||
"spec": "0.2.4",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express",
|
||||
"/send"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz",
|
||||
"_shasum": "3582499206c9723714190edd74b4604feb4a614c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "fresh@0.2.4",
|
||||
"_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express",
|
||||
"author": {
|
||||
"name": "TJ Holowaychuk",
|
||||
"email": "tj@vision-media.ca",
|
||||
"url": "http://tjholowaychuk.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/fresh/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "HTTP response freshness testing",
|
||||
"devDependencies": {
|
||||
"istanbul": "0",
|
||||
"mocha": "1",
|
||||
"should": "3"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "3582499206c9723714190edd74b4604feb4a614c",
|
||||
"tarball": "https://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "8440a4ca75fb091dec06e88654b3b1c31d7e7164",
|
||||
"homepage": "https://github.com/jshttp/fresh",
|
||||
"keywords": [
|
||||
"fresh",
|
||||
"http",
|
||||
"conditional",
|
||||
"cache"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "jonathanong",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "fresh",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/fresh.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec --require should",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should"
|
||||
},
|
||||
"version": "0.2.4"
|
||||
}
|
||||
Reference in New Issue
Block a user