From e2eacf6e96f248889160d76060194f00d425020d Mon Sep 17 00:00:00 2001 From: Ian Deans Date: Mon, 3 Oct 2016 11:16:58 -0700 Subject: [PATCH 1/2] scolfold project --- .gitignore | 30 + app.js | 60 ++ bin/www | 90 +++ node_modules/accepts/HISTORY.md | 42 -- node_modules/accepts/package.json | 73 ++- node_modules/array-flatten/package.json | 4 +- node_modules/content-disposition/package.json | 4 +- node_modules/content-type/package.json | 5 +- node_modules/cookie-signature/package.json | 5 +- node_modules/cookie/package.json | 6 +- node_modules/debug/package.json | 10 +- node_modules/depd/package.json | 9 +- node_modules/destroy/package.json | 7 +- node_modules/ee-first/package.json | 4 +- node_modules/encodeurl/HISTORY.md | 9 - node_modules/encodeurl/LICENSE | 22 - node_modules/encodeurl/README.md | 124 ---- node_modules/encodeurl/index.js | 60 -- node_modules/encodeurl/package.json | 112 ---- node_modules/escape-html/package.json | 7 +- node_modules/etag/package.json | 8 +- node_modules/express/History.md | 80 --- node_modules/express/Readme.md | 4 - node_modules/express/lib/middleware/query.js | 11 +- node_modules/express/lib/request.js | 49 +- node_modules/express/lib/response.js | 30 +- node_modules/express/lib/router/index.js | 2 +- node_modules/express/lib/utils.js | 9 +- node_modules/express/package.json | 100 ++-- node_modules/finalhandler/HISTORY.md | 10 - node_modules/finalhandler/README.md | 13 +- node_modules/finalhandler/index.js | 78 +-- node_modules/finalhandler/package.json | 66 ++- node_modules/forwarded/package.json | 4 +- node_modules/fresh/package.json | 8 +- node_modules/http-errors/package.json | 6 +- node_modules/inherits/package.json | 8 +- node_modules/ipaddr.js/README.md | 48 -- node_modules/ipaddr.js/bower.json | 2 +- node_modules/ipaddr.js/ipaddr.min.js | 2 +- node_modules/ipaddr.js/lib/ipaddr.js | 81 +-- node_modules/ipaddr.js/package.json | 38 +- node_modules/ipaddr.js/src/ipaddr.coffee | 80 +-- .../ipaddr.js/test/ipaddr.test.coffee | 61 +- node_modules/media-typer/package.json | 4 +- node_modules/merge-descriptors/package.json | 4 +- node_modules/methods/package.json | 4 +- node_modules/mime-db/package.json | 4 +- node_modules/mime-types/package.json | 4 +- node_modules/mime/package.json | 7 +- node_modules/ms/package.json | 8 +- node_modules/negotiator/HISTORY.md | 22 - node_modules/negotiator/README.md | 4 +- node_modules/negotiator/index.js | 72 +-- node_modules/negotiator/lib/charset.js | 79 +-- node_modules/negotiator/lib/encoding.js | 78 +-- node_modules/negotiator/lib/language.js | 79 +-- node_modules/negotiator/lib/mediaType.js | 177 +----- node_modules/negotiator/package.json | 53 +- node_modules/on-finished/package.json | 9 +- node_modules/parseurl/package.json | 5 +- node_modules/path-to-regexp/package.json | 4 +- node_modules/proxy-addr/HISTORY.md | 19 - node_modules/proxy-addr/LICENSE | 2 +- node_modules/proxy-addr/README.md | 1 + node_modules/proxy-addr/index.js | 144 +++-- node_modules/proxy-addr/package.json | 69 ++- node_modules/qs/package.json | 6 +- node_modules/range-parser/HISTORY.md | 15 +- node_modules/range-parser/LICENSE | 3 +- node_modules/range-parser/README.md | 26 +- node_modules/range-parser/index.js | 143 +---- node_modules/range-parser/package.json | 75 +-- node_modules/send/HISTORY.md | 36 -- node_modules/send/LICENSE | 2 +- node_modules/send/README.md | 98 +-- node_modules/send/index.js | 556 +++++++----------- node_modules/send/package.json | 70 +-- node_modules/serve-static/HISTORY.md | 23 - node_modules/serve-static/LICENSE | 2 +- node_modules/serve-static/README.md | 23 +- node_modules/serve-static/index.js | 7 +- node_modules/serve-static/package.json | 57 +- node_modules/setprototypeof/package.json | 4 +- node_modules/statuses/package.json | 24 +- node_modules/type-is/package.json | 5 +- node_modules/unpipe/package.json | 27 +- node_modules/utils-merge/package.json | 4 +- node_modules/vary/HISTORY.md | 6 - node_modules/vary/index.js | 17 +- node_modules/vary/package.json | 40 +- package.json | 28 +- public/stylesheets/style.css | 8 + routes/index.js | 9 + routes/users.js | 9 + views/error.hbs | 3 + views/index.hbs | 2 + views/layout.hbs | 10 + 98 files changed, 1189 insertions(+), 2482 deletions(-) create mode 100644 .gitignore create mode 100644 app.js create mode 100755 bin/www delete mode 100644 node_modules/encodeurl/HISTORY.md delete mode 100644 node_modules/encodeurl/LICENSE delete mode 100644 node_modules/encodeurl/README.md delete mode 100644 node_modules/encodeurl/index.js delete mode 100644 node_modules/encodeurl/package.json create mode 100644 public/stylesheets/style.css create mode 100644 routes/index.js create mode 100644 routes/users.js create mode 100644 views/error.hbs create mode 100644 views/index.hbs create mode 100644 views/layout.hbs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..392150b --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://docs.npmjs.com/cli/shrinkwrap#caveats +node_modules + +# Debug log from npm +npm-debug.log diff --git a/app.js b/app.js new file mode 100644 index 0000000..2acb20e --- /dev/null +++ b/app.js @@ -0,0 +1,60 @@ +var express = require('express'); +var path = require('path'); +var favicon = require('serve-favicon'); +var logger = require('morgan'); +var cookieParser = require('cookie-parser'); +var bodyParser = require('body-parser'); + +var routes = require('./routes/index'); +var users = require('./routes/users'); + +var app = express(); + +// view engine setup +app.set('views', path.join(__dirname, 'views')); +app.set('view engine', 'hbs'); + +// uncomment after placing your favicon in /public +//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); +app.use(logger('dev')); +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: false })); +app.use(cookieParser()); +app.use(express.static(path.join(__dirname, 'public'))); + +app.use('/', routes); +app.use('/users', users); + +// catch 404 and forward to error handler +app.use(function(req, res, next) { + var err = new Error('Not Found'); + err.status = 404; + next(err); +}); + +// error handlers + +// development error handler +// will print stacktrace +if (app.get('env') === 'development') { + app.use(function(err, req, res, next) { + res.status(err.status || 500); + res.render('error', { + message: err.message, + error: err + }); + }); +} + +// production error handler +// no stacktraces leaked to user +app.use(function(err, req, res, next) { + res.status(err.status || 500); + res.render('error', { + message: err.message, + error: {} + }); +}); + + +module.exports = app; diff --git a/bin/www b/bin/www new file mode 100755 index 0000000..7150bce --- /dev/null +++ b/bin/www @@ -0,0 +1,90 @@ +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var app = require('../app'); +var debug = require('debug')('freezing-ringtail:server'); +var http = require('http'); + +/** + * Get port from environment and store in Express. + */ + +var port = normalizePort(process.env.PORT || '3000'); +app.set('port', port); + +/** + * Create HTTP server. + */ + +var server = http.createServer(app); + +/** + * Listen on provided port, on all network interfaces. + */ + +server.listen(port); +server.on('error', onError); +server.on('listening', onListening); + +/** + * Normalize a port into a number, string, or false. + */ + +function normalizePort(val) { + var port = parseInt(val, 10); + + if (isNaN(port)) { + // named pipe + return val; + } + + if (port >= 0) { + // port number + return port; + } + + return false; +} + +/** + * Event listener for HTTP server "error" event. + */ + +function onError(error) { + if (error.syscall !== 'listen') { + throw error; + } + + var bind = typeof port === 'string' + ? 'Pipe ' + port + : 'Port ' + port; + + // handle specific listen errors with friendly messages + switch (error.code) { + case 'EACCES': + console.error(bind + ' requires elevated privileges'); + process.exit(1); + break; + case 'EADDRINUSE': + console.error(bind + ' is already in use'); + process.exit(1); + break; + default: + throw error; + } +} + +/** + * Event listener for HTTP server "listening" event. + */ + +function onListening() { + var addr = server.address(); + var bind = typeof addr === 'string' + ? 'pipe ' + addr + : 'port ' + addr.port; + debug('Listening on ' + bind); +} diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md index 0477ed7..397636e 100644 --- a/node_modules/accepts/HISTORY.md +++ b/node_modules/accepts/HISTORY.md @@ -1,45 +1,3 @@ -1.3.3 / 2016-05-02 -================== - - * deps: mime-types@~2.1.11 - - deps: mime-db@~1.23.0 - * deps: negotiator@0.6.1 - - perf: improve `Accept` parsing speed - - perf: improve `Accept-Charset` parsing speed - - perf: improve `Accept-Encoding` parsing speed - - perf: improve `Accept-Language` parsing speed - -1.3.2 / 2016-03-08 -================== - - * deps: mime-types@~2.1.10 - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - - deps: mime-db@~1.22.0 - -1.3.1 / 2016-01-19 -================== - - * deps: mime-types@~2.1.9 - - deps: mime-db@~1.21.0 - -1.3.0 / 2015-09-29 -================== - - * deps: mime-types@~2.1.7 - - deps: mime-db@~1.19.0 - * deps: negotiator@0.6.0 - - Fix including type extensions in parameters in `Accept` parsing - - Fix parsing `Accept` parameters with quoted equals - - Fix parsing `Accept` parameters with quoted semicolons - - Lazy-load modules from main entry point - - perf: delay type concatenation until needed - - perf: enable strict mode - - perf: hoist regular expressions - - perf: remove closures getting spec properties - - perf: remove a closure from media type parsing - - perf: remove property delete from media type parsing - 1.2.13 / 2015-09-06 =================== diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json index 2e267e2..5a21e31 100644 --- a/node_modules/accepts/package.json +++ b/node_modules/accepts/package.json @@ -2,50 +2,45 @@ "_args": [ [ { - "raw": "accepts@~1.3.3", + "raw": "accepts@~1.2.12", "scope": null, "escapedName": "accepts", "name": "accepts", - "rawSpec": "~1.3.3", - "spec": ">=1.3.3 <1.4.0", + "rawSpec": "~1.2.12", + "spec": ">=1.2.12 <1.3.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "accepts@>=1.3.3 <1.4.0", - "_id": "accepts@1.3.3", + "_from": "accepts@>=1.2.12 <1.3.0", + "_id": "accepts@1.2.13", "_inCache": true, "_installable": true, "_location": "/accepts", - "_nodeVersion": "4.4.3", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/accepts-1.3.3.tgz_1462251932032_0.7092335098423064" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.15.1", + "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "accepts@~1.3.3", + "raw": "accepts@~1.2.12", "scope": null, "escapedName": "accepts", "name": "accepts", - "rawSpec": "~1.3.3", - "spec": ">=1.3.3 <1.4.0", + "rawSpec": "~1.2.12", + "spec": ">=1.2.12 <1.3.0", "type": "range" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", - "_shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca", + "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", + "_shasum": "e5f1f3928c6d95fd96558c36ec3d9d0de4a6ecea", "_shrinkwrap": null, - "_spec": "accepts@~1.3.3", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "accepts@~1.2.12", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "bugs": { "url": "https://github.com/jshttp/accepts/issues" }, @@ -61,18 +56,18 @@ } ], "dependencies": { - "mime-types": "~2.1.11", - "negotiator": "0.6.1" + "mime-types": "~2.1.6", + "negotiator": "0.5.3" }, "description": "Higher-level content negotiation", "devDependencies": { - "istanbul": "0.4.3", + "istanbul": "0.3.19", "mocha": "~1.21.5" }, "directories": {}, "dist": { - "shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca", - "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz" + "shasum": "e5f1f3928c6d95fd96558c36ec3d9d0de4a6ecea", + "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz" }, "engines": { "node": ">= 0.6" @@ -82,8 +77,8 @@ "HISTORY.md", "index.js" ], - "gitHead": "3e925b1e65ed7da2798849683d49814680dfa426", - "homepage": "https://github.com/jshttp/accepts#readme", + "gitHead": "b7e15ecb25dacc0b2133ed0553d64f8a79537e01", + "homepage": "https://github.com/jshttp/accepts", "keywords": [ "content", "negotiation", @@ -92,9 +87,33 @@ ], "license": "MIT", "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "federomero", + "email": "federomero@gmail.com" + }, { "name": "dougwilson", "email": "doug@somethingdoug.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "mscdex", + "email": "mscdex@mscdex.net" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" } ], "name": "accepts", @@ -109,5 +128,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "version": "1.3.3" + "version": "1.2.13" } diff --git a/node_modules/array-flatten/package.json b/node_modules/array-flatten/package.json index 9275388..25bf04c 100644 --- a/node_modules/array-flatten/package.json +++ b/node_modules/array-flatten/package.json @@ -10,7 +10,7 @@ "spec": "1.1.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "array-flatten@1.1.1", @@ -41,7 +41,7 @@ "_shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2", "_shrinkwrap": null, "_spec": "array-flatten@1.1.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Blake Embrey", "email": "hello@blakeembrey.com", diff --git a/node_modules/content-disposition/package.json b/node_modules/content-disposition/package.json index 16cf855..aa4610a 100644 --- a/node_modules/content-disposition/package.json +++ b/node_modules/content-disposition/package.json @@ -10,7 +10,7 @@ "spec": "0.5.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "content-disposition@0.5.1", @@ -40,7 +40,7 @@ "_shasum": "87476c6a67c8daa87e32e87616df883ba7fb071b", "_shrinkwrap": null, "_spec": "content-disposition@0.5.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "bugs": { "url": "https://github.com/jshttp/content-disposition/issues" }, diff --git a/node_modules/content-type/package.json b/node_modules/content-type/package.json index 59e08e5..1b59744 100644 --- a/node_modules/content-type/package.json +++ b/node_modules/content-type/package.json @@ -10,7 +10,7 @@ "spec": ">=1.0.2 <1.1.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser" ] ], "_from": "content-type@>=1.0.2 <1.1.0", @@ -39,13 +39,14 @@ "type": "range" }, "_requiredBy": [ + "/body-parser", "/express" ], "_resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", "_shasum": "b7d113aee7a8dd27bd21133c4dc2529df1721eed", "_shrinkwrap": null, "_spec": "content-type@~1.0.2", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" diff --git a/node_modules/cookie-signature/package.json b/node_modules/cookie-signature/package.json index 3d3ca7f..af05ffc 100644 --- a/node_modules/cookie-signature/package.json +++ b/node_modules/cookie-signature/package.json @@ -10,7 +10,7 @@ "spec": "1.0.6", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/cookie-parser" ] ], "_from": "cookie-signature@1.0.6", @@ -35,13 +35,14 @@ "type": "version" }, "_requiredBy": [ + "/cookie-parser", "/express" ], "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "_shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", "_shrinkwrap": null, "_spec": "cookie-signature@1.0.6", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/cookie-parser", "author": { "name": "TJ Holowaychuk", "email": "tj@learnboost.com" diff --git a/node_modules/cookie/package.json b/node_modules/cookie/package.json index b8ae358..7f19713 100644 --- a/node_modules/cookie/package.json +++ b/node_modules/cookie/package.json @@ -10,7 +10,7 @@ "spec": "0.3.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/cookie-parser" ] ], "_from": "cookie@0.3.1", @@ -38,13 +38,13 @@ "type": "version" }, "_requiredBy": [ - "/express" + "/cookie-parser" ], "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", "_shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb", "_shrinkwrap": null, "_spec": "cookie@0.3.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/cookie-parser", "author": { "name": "Roman Shtylman", "email": "shtylman@gmail.com" diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index d372ce1..fe24144 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -10,7 +10,7 @@ "spec": ">=2.2.0 <2.3.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail" ] ], "_from": "debug@>=2.2.0 <2.3.0", @@ -35,15 +35,19 @@ "type": "range" }, "_requiredBy": [ + "/", + "/body-parser", "/express", "/finalhandler", - "/send" + "/morgan", + "/send", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", "_shrinkwrap": null, "_spec": "debug@~2.2.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" diff --git a/node_modules/depd/package.json b/node_modules/depd/package.json index 34aa84c..b169bde 100644 --- a/node_modules/depd/package.json +++ b/node_modules/depd/package.json @@ -10,7 +10,7 @@ "spec": ">=1.1.0 <1.2.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser" ] ], "_from": "depd@>=1.1.0 <1.2.0", @@ -34,14 +34,17 @@ "type": "range" }, "_requiredBy": [ + "/body-parser", "/express", - "/send" + "/morgan", + "/send", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", "_shasum": "e1bd82c6aab6ced965b97b88b17ed3e528ca18c3", "_shrinkwrap": null, "_spec": "depd@~1.1.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json index 0371c2f..a2c0283 100644 --- a/node_modules/destroy/package.json +++ b/node_modules/destroy/package.json @@ -10,7 +10,7 @@ "spec": ">=1.0.4 <1.1.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/send" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/send" ] ], "_from": "destroy@>=1.0.4 <1.1.0", @@ -34,13 +34,14 @@ "type": "range" }, "_requiredBy": [ - "/send" + "/send", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "_shasum": "978857442c44749e4206613e37946205826abd80", "_shrinkwrap": null, "_spec": "destroy@~1.0.4", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/send", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/send", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", diff --git a/node_modules/ee-first/package.json b/node_modules/ee-first/package.json index ab42f46..0008e49 100644 --- a/node_modules/ee-first/package.json +++ b/node_modules/ee-first/package.json @@ -10,7 +10,7 @@ "spec": "1.1.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/on-finished" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/on-finished" ] ], "_from": "ee-first@1.1.1", @@ -40,7 +40,7 @@ "_shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", "_shrinkwrap": null, "_spec": "ee-first@1.1.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/on-finished", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/on-finished", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", diff --git a/node_modules/encodeurl/HISTORY.md b/node_modules/encodeurl/HISTORY.md deleted file mode 100644 index 06d34a5..0000000 --- a/node_modules/encodeurl/HISTORY.md +++ /dev/null @@ -1,9 +0,0 @@ -1.0.1 / 2016-06-09 -================== - - * Fix encoding unpaired surrogates at start/end of string - -1.0.0 / 2016-06-08 -================== - - * Initial release diff --git a/node_modules/encodeurl/LICENSE b/node_modules/encodeurl/LICENSE deleted file mode 100644 index 8812229..0000000 --- a/node_modules/encodeurl/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2016 Douglas Christopher Wilson - -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. diff --git a/node_modules/encodeurl/README.md b/node_modules/encodeurl/README.md deleted file mode 100644 index b086133..0000000 --- a/node_modules/encodeurl/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# encodeurl - -[![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] - -Encode a URL to a percent-encoded form, excluding already-encoded sequences - -## Installation - -```sh -$ npm install encodeurl -``` - -## API - -```js -var encodeUrl = require('encodeurl') -``` - -### encodeUrl(url) - -Encode a URL to a percent-encoded form, excluding already-encoded sequences. - -This function will take an already-encoded URL and encode all the non-URL -code points (as UTF-8 byte sequences). This function will not encode the -"%" character unless it is not part of a valid sequence (`%20` will be -left as-is, but `%foo` will be encoded as `%25foo`). - -This encode is meant to be "safe" and does not throw errors. It will try as -hard as it can to properly encode the given URL, including replacing any raw, -unpaired surrogate pairs with the Unicode replacement character prior to -encoding. - -This function is _similar_ to the intrinsic function `encodeURI`, except it -will not encode the `%` character if that is part of a valid sequence, will -not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired -surrogate pairs with the Unicode replacement character (instead of throwing). - -## Examples - -### Encode a URL containing user-controled data - -```js -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') - -http.createServer(function onRequest (req, res) { - // get encoded form of inbound url - var url = encodeUrl(req.url) - - // create html message - var body = '

Location ' + escapeHtml(url) + ' not found

' - - // send a 404 - res.statusCode = 404 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) - res.end(body, 'utf-8') -}) -``` - -### Encode a URL for use in a header field - -```js -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') -var url = require('url') - -http.createServer(function onRequest (req, res) { - // parse inbound url - var href = url.parse(req) - - // set new host for redirect - href.host = 'localhost' - href.protocol = 'https:' - href.slashes = true - - // create location header - var location = encodeUrl(url.format(href)) - - // create html message - var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' - - // send a 301 - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) - res.setHeader('Location', location) - res.end(body, 'utf-8') -}) -``` - -## Testing - -```sh -$ npm test -$ npm run lint -``` - -## References - -- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] -- [WHATWG URL Living Standard][whatwg-url] - -[rfc-3986]: https://tools.ietf.org/html/rfc3986 -[whatwg-url]: https://url.spec.whatwg.org/ - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/encodeurl.svg -[npm-url]: https://npmjs.org/package/encodeurl -[node-version-image]: https://img.shields.io/node/v/encodeurl.svg -[node-version-url]: https://nodejs.org/en/download -[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg -[travis-url]: https://travis-ci.org/pillarjs/encodeurl -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master -[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg -[downloads-url]: https://npmjs.org/package/encodeurl diff --git a/node_modules/encodeurl/index.js b/node_modules/encodeurl/index.js deleted file mode 100644 index ae77cc9..0000000 --- a/node_modules/encodeurl/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * encodeurl - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = encodeUrl - -/** - * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") - * and including invalid escape sequences. - * @private - */ - -var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]))+/g - -/** - * RegExp to match unmatched surrogate pair. - * @private - */ - -var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g - -/** - * String to replace unmatched surrogate pair with. - * @private - */ - -var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' - -/** - * Encode a URL to a percent-encoded form, excluding already-encoded sequences. - * - * This function will take an already-encoded URL and encode all the non-URL - * code points. This function will not encode the "%" character unless it is - * not part of a valid sequence (`%20` will be left as-is, but `%foo` will - * be encoded as `%25foo`). - * - * This encode is meant to be "safe" and does not throw errors. It will try as - * hard as it can to properly encode the given URL, including replacing any raw, - * unpaired surrogate pairs with the Unicode replacement character prior to - * encoding. - * - * @param {string} url - * @return {string} - * @public - */ - -function encodeUrl (url) { - return String(url) - .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) - .replace(ENCODE_CHARS_REGEXP, encodeURI) -} diff --git a/node_modules/encodeurl/package.json b/node_modules/encodeurl/package.json deleted file mode 100644 index 182e299..0000000 --- a/node_modules/encodeurl/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "encodeurl@~1.0.1", - "scope": null, - "escapedName": "encodeurl", - "name": "encodeurl", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" - ] - ], - "_from": "encodeurl@>=1.0.1 <1.1.0", - "_id": "encodeurl@1.0.1", - "_inCache": true, - "_installable": true, - "_location": "/encodeurl", - "_nodeVersion": "4.4.3", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/encodeurl-1.0.1.tgz_1465519736251_0.09314409433864057" - }, - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - "_npmVersion": "2.15.1", - "_phantomChildren": {}, - "_requested": { - "raw": "encodeurl@~1.0.1", - "scope": null, - "escapedName": "encodeurl", - "name": "encodeurl", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/express", - "/send", - "/serve-static" - ], - "_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "_shasum": "79e3d58655346909fe6f0f45a5de68103b294d20", - "_shrinkwrap": null, - "_spec": "encodeurl@~1.0.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", - "bugs": { - "url": "https://github.com/pillarjs/encodeurl/issues" - }, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "dependencies": {}, - "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", - "devDependencies": { - "eslint": "2.11.1", - "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.3.2", - "eslint-plugin-standard": "1.3.2", - "istanbul": "0.4.3", - "mocha": "2.5.3" - }, - "directories": {}, - "dist": { - "shasum": "79e3d58655346909fe6f0f45a5de68103b294d20", - "tarball": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "gitHead": "39ed0c235fed4cea7d012038fd6bb0480561d226", - "homepage": "https://github.com/pillarjs/encodeurl#readme", - "keywords": [ - "encode", - "encodeurl", - "url" - ], - "license": "MIT", - "maintainers": [ - { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - } - ], - "name": "encodeurl", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/pillarjs/encodeurl.git" - }, - "scripts": { - "lint": "eslint **/*.js", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.0.1" -} diff --git a/node_modules/escape-html/package.json b/node_modules/escape-html/package.json index 27c2b8a..1e4985e 100644 --- a/node_modules/escape-html/package.json +++ b/node_modules/escape-html/package.json @@ -10,7 +10,7 @@ "spec": ">=1.0.3 <1.1.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "escape-html@>=1.0.3 <1.1.0", @@ -37,13 +37,14 @@ "/express", "/finalhandler", "/send", - "/serve-static" + "/serve-static", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988", "_shrinkwrap": null, "_spec": "escape-html@~1.0.3", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "bugs": { "url": "https://github.com/component/escape-html/issues" }, diff --git a/node_modules/etag/package.json b/node_modules/etag/package.json index 02b133d..bb2325a 100644 --- a/node_modules/etag/package.json +++ b/node_modules/etag/package.json @@ -10,7 +10,7 @@ "spec": ">=1.7.0 <1.8.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "etag@>=1.7.0 <1.8.0", @@ -35,13 +35,15 @@ }, "_requiredBy": [ "/express", - "/send" + "/send", + "/serve-favicon", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/etag/-/etag-1.7.0.tgz", "_shasum": "03d30b5f67dd6e632d2945d30d6652731a34d5d8", "_shrinkwrap": null, "_spec": "etag@~1.7.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "bugs": { "url": "https://github.com/jshttp/etag/issues" }, diff --git a/node_modules/express/History.md b/node_modules/express/History.md index 40a5ed7..c72241b 100644 --- a/node_modules/express/History.md +++ b/node_modules/express/History.md @@ -1,83 +1,3 @@ -4.14.0 / 2016-06-16 -=================== - - * Add `acceptRanges` option to `res.sendFile`/`res.sendfile` - * Add `cacheControl` option to `res.sendFile`/`res.sendfile` - * Add `options` argument to `req.range` - - Includes the `combine` option - * Encode URL in `res.location`/`res.redirect` if not already encoded - * Fix some redirect handling in `res.sendFile`/`res.sendfile` - * Fix Windows absolute path check using forward slashes - * Improve error with invalid arguments to `req.get()` - * Improve performance for `res.json`/`res.jsonp` in most cases - * Improve `Range` header handling in `res.sendFile`/`res.sendfile` - * deps: accepts@~1.3.3 - - Fix including type extensions in parameters in `Accept` parsing - - Fix parsing `Accept` parameters with quoted equals - - Fix parsing `Accept` parameters with quoted semicolons - - Many performance improvments - - deps: mime-types@~2.1.11 - - deps: negotiator@0.6.1 - * deps: content-type@~1.0.2 - - perf: enable strict mode - * deps: cookie@0.3.1 - - Add `sameSite` option - - Fix cookie `Max-Age` to never be a floating point number - - Improve error message when `encode` is not a function - - Improve error message when `expires` is not a `Date` - - Throw better error for invalid argument to parse - - Throw on invalid values provided to `serialize` - - perf: enable strict mode - - perf: hoist regular expression - - perf: use for loop in parse - - perf: use string concatination for serialization - * deps: finalhandler@0.5.0 - - Change invalid or non-numeric status code to 500 - - Overwrite status message to match set status code - - Prefer `err.statusCode` if `err.status` is invalid - - Set response headers from `err.headers` object - - Use `statuses` instead of `http` module for status messages - * deps: proxy-addr@~1.1.2 - - Fix accepting various invalid netmasks - - Fix IPv6-mapped IPv4 validation edge cases - - IPv4 netmasks must be contingous - - IPv6 addresses cannot be used as a netmask - - deps: ipaddr.js@1.1.1 - * deps: qs@6.2.0 - - Add `decoder` option in `parse` function - * deps: range-parser@~1.2.0 - - Add `combine` option to combine overlapping ranges - - Fix incorrectly returning -1 when there is at least one valid range - - perf: remove internal function - * deps: send@0.14.1 - - Add `acceptRanges` option - - Add `cacheControl` option - - Attempt to combine multiple ranges into single range - - Correctly inherit from `Stream` class - - Fix `Content-Range` header in 416 responses when using `start`/`end` options - - Fix `Content-Range` header missing from default 416 responses - - Fix redirect error when `path` contains raw non-URL characters - - Fix redirect when `path` starts with multiple forward slashes - - Ignore non-byte `Range` headers - - deps: http-errors@~1.5.0 - - deps: range-parser@~1.2.0 - - deps: statuses@~1.3.0 - - perf: remove argument reassignment - * deps: serve-static@~1.11.1 - - Add `acceptRanges` option - - Add `cacheControl` option - - Attempt to combine multiple ranges into single range - - Fix redirect error when `req.url` contains raw non-URL characters - - Ignore non-byte `Range` headers - - Use status code 301 for redirects - - deps: send@0.14.1 - * deps: type-is@~1.6.13 - - Fix type error when given invalid type to match against - - deps: mime-types@~2.1.11 - * deps: vary@~1.1.0 - - Only accept valid field names in the `field` argument - * perf: use strict equality when possible - 4.13.4 / 2016-01-21 =================== diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md index e9bfaeb..6e08454 100644 --- a/node_modules/express/Readme.md +++ b/node_modules/express/Readme.md @@ -37,16 +37,12 @@ $ npm install express ## Docs & Community - * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/strongloop/expressjs.com)] * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC * [Github Organization](https://github.com/expressjs) for Official Middleware & Modules - * Visit the [Wiki](https://github.com/expressjs/express/wiki) * [Google Group](https://groups.google.com/group/express-js) for discussion * [Gitter](https://gitter.im/expressjs/express) for support and discussion * [Русскоязычная документация](http://jsman.ru/express/) -**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x). - ###Security Issues If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md). diff --git a/node_modules/express/lib/middleware/query.js b/node_modules/express/lib/middleware/query.js index 5f76f84..a665f3f 100644 --- a/node_modules/express/lib/middleware/query.js +++ b/node_modules/express/lib/middleware/query.js @@ -30,9 +30,14 @@ module.exports = function query(options) { opts = undefined; } - if (opts !== undefined && opts.allowPrototypes === undefined) { - // back-compat for qs module - opts.allowPrototypes = true; + if (opts !== undefined) { + if (opts.allowDots === undefined) { + opts.allowDots = false; + } + + if (opts.allowPrototypes === undefined) { + opts.allowPrototypes = true; + } } return function query(req, res, next){ diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js index 557d050..33cac18 100644 --- a/node_modules/express/lib/request.js +++ b/node_modules/express/lib/request.js @@ -57,14 +57,6 @@ var req = exports = module.exports = { req.get = req.header = function header(name) { - if (!name) { - throw new TypeError('name argument is required to req.get'); - } - - if (typeof name !== 'string') { - throw new TypeError('name must be a string to req.get'); - } - var lc = name.toLowerCase(); switch (lc) { @@ -179,34 +171,29 @@ req.acceptsLanguage = deprecate.function(req.acceptsLanguages, 'req.acceptsLanguage: Use acceptsLanguages instead'); /** - * Parse Range header field, capping to the given `size`. + * Parse Range header field, + * capping to the given `size`. * - * Unspecified ranges such as "0-" require knowledge of your resource length. In - * the case of a byte range this is of course the total number of bytes. If the - * Range header field is not given `undefined` is returned, `-1` when unsatisfiable, - * and `-2` when syntactically invalid. + * Unspecified ranges such as "0-" require + * knowledge of your resource length. In + * the case of a byte range this is of course + * the total number of bytes. If the Range + * header field is not given `null` is returned, + * `-1` when unsatisfiable, `-2` when syntactically invalid. * - * When ranges are returned, the array has a "type" property which is the type of - * range that is required (most commonly, "bytes"). Each array element is an object - * with a "start" and "end" property for the portion of the range. + * NOTE: remember that ranges are inclusive, so + * for example "Range: users=0-3" should respond + * with 4 users when available, not 3. * - * The "combine" option can be set to `true` and overlapping & adjacent ranges - * will be combined into a single range. - * - * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" - * should respond with 4 users when available, not 3. - * - * @param {number} size - * @param {object} [options] - * @param {boolean} [options.combine=false] - * @return {number|array} + * @param {Number} size + * @return {Array} * @public */ -req.range = function range(size, options) { +req.range = function(size){ var range = this.get('Range'); if (!range) return; - return parseRange(size, range, options); + return parseRange(size, range); }; /** @@ -316,7 +303,7 @@ defineGetter(req, 'protocol', function protocol(){ /** * Short-hand for: * - * req.protocol === 'https' + * req.protocol == 'https' * * @return {Boolean} * @public @@ -450,10 +437,10 @@ defineGetter(req, 'fresh', function(){ var s = this.res.statusCode; // GET or HEAD for weak freshness validation only - if ('GET' !== method && 'HEAD' !== method) return false; + if ('GET' != method && 'HEAD' != method) return false; // 2xx or 304 as per rfc2616 14.26 - if ((s >= 200 && s < 300) || 304 === s) { + if ((s >= 200 && s < 300) || 304 == s) { return fresh(this.headers, (this.res._headers || {})); } diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js index 6128f45..641704b 100644 --- a/node_modules/express/lib/response.js +++ b/node_modules/express/lib/response.js @@ -14,7 +14,6 @@ var contentDisposition = require('content-disposition'); var deprecate = require('depd')('express'); -var encodeUrl = require('encodeurl'); var escapeHtml = require('escape-html'); var http = require('http'); var isAbsolute = require('./utils').isAbsolute; @@ -190,7 +189,7 @@ res.send = function send(body) { if (req.fresh) this.statusCode = 304; // strip irrelevant headers - if (204 === this.statusCode || 304 === this.statusCode) { + if (204 == this.statusCode || 304 == this.statusCode) { this.removeHeader('Content-Type'); this.removeHeader('Content-Length'); this.removeHeader('Transfer-Encoding'); @@ -240,7 +239,7 @@ res.json = function json(obj) { var app = this.app; var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); - var body = stringify(val, replacer, spaces); + var body = JSON.stringify(val, replacer, spaces); // content-type if (!this.get('Content-Type')) { @@ -282,7 +281,7 @@ res.jsonp = function jsonp(obj) { var app = this.app; var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); - var body = stringify(val, replacer, spaces); + var body = JSON.stringify(val, replacer, spaces); var callback = this.req.query[app.get('jsonp callback name')]; // content-type @@ -741,7 +740,7 @@ res.get = function(field){ * Clear cookie `name`. * * @param {String} name - * @param {Object} [options] + * @param {Object} options * @return {ServerResponse} for chaining * @public */ @@ -833,7 +832,8 @@ res.location = function location(url) { } // set location - return this.set('Location', encodeUrl(loc)); + this.set('Location', loc); + return this; }; /** @@ -871,12 +871,13 @@ res.redirect = function redirect(url) { } // Set location header - address = this.location(address).get('Location'); + this.location(address); + address = this.get('Location'); // Support text/{plain,html} by default this.format({ text: function(){ - body = statusCodes[status] + '. Redirecting to ' + address; + body = statusCodes[status] + '. Redirecting to ' + encodeURI(address); }, html: function(){ @@ -1050,16 +1051,3 @@ function sendfile(res, file, options, callback) { // pipe file.pipe(res); } - -/** - * Stringify JSON, like JSON.stringify, but v8 optimized. - * @private - */ - -function stringify(value, replacer, spaces) { - // v8 checks arguments.length for optimizing simple call - // https://bugs.chromium.org/p/v8/issues/detail?id=4730 - return replacer || spaces - ? JSON.stringify(value, replacer, spaces) - : JSON.stringify(value); -} diff --git a/node_modules/express/lib/router/index.js b/node_modules/express/lib/router/index.js index dac2514..504ed9c 100644 --- a/node_modules/express/lib/router/index.js +++ b/node_modules/express/lib/router/index.js @@ -119,7 +119,7 @@ proto.param = function param(name, fn) { // ensure we end up with a // middleware function - if ('function' !== typeof fn) { + if ('function' != typeof fn) { throw new Error('invalid param() call for ' + name + ', got ' + fn); } diff --git a/node_modules/express/lib/utils.js b/node_modules/express/lib/utils.js index f418c58..3d54247 100644 --- a/node_modules/express/lib/utils.js +++ b/node_modules/express/lib/utils.js @@ -66,9 +66,9 @@ exports.wetag = function wetag(body, encoding){ */ exports.isAbsolute = function(path){ - if ('/' === path[0]) return true; - if (':' === path[1] && ('\\' === path[2] || '/' === path[2])) return true; // Windows device path - if ('\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path + if ('/' == path[0]) return true; + if (':' == path[1] && '\\' == path[2]) return true; + if ('\\\\' == path.substring(0, 2)) return true; // Microsoft Azure absolute path }; /** @@ -142,7 +142,7 @@ function acceptParams(str, index) { for (var i = 1; i < parts.length; ++i) { var pms = parts[i].split(/ *= */); - if ('q' === pms[0]) { + if ('q' == pms[0]) { ret.quality = parseFloat(pms[1]); } else { ret.params[pms[0]] = pms[1]; @@ -283,6 +283,7 @@ exports.setCharset = function setCharset(type, charset) { function parseExtendedQueryString(str) { return qs.parse(str, { + allowDots: false, allowPrototypes: true }); } diff --git a/node_modules/express/package.json b/node_modules/express/package.json index 565d565..b8fb8bc 100644 --- a/node_modules/express/package.json +++ b/node_modules/express/package.json @@ -2,26 +2,22 @@ "_args": [ [ { - "raw": "express", + "raw": "express@~4.13.4", "scope": null, "escapedName": "express", "name": "express", - "rawSpec": "", - "spec": "latest", - "type": "tag" + "rawSpec": "~4.13.4", + "spec": ">=4.13.4 <4.14.0", + "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail" ] ], - "_from": "express@latest", - "_id": "express@4.14.0", + "_from": "express@>=4.13.4 <4.14.0", + "_id": "express@4.13.4", "_inCache": true, "_installable": true, "_location": "/express", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/express-4.14.0.tgz_1466095407850_0.17484632693231106" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -29,23 +25,22 @@ "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "express", + "raw": "express@~4.13.4", "scope": null, "escapedName": "express", "name": "express", - "rawSpec": "", - "spec": "latest", - "type": "tag" + "rawSpec": "~4.13.4", + "spec": ">=4.13.4 <4.14.0", + "type": "range" }, "_requiredBy": [ - "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/express/-/express-4.14.0.tgz", - "_shasum": "c1ee3f42cdc891fb3dc650a8922d51ec847d0d66", + "_resolved": "https://registry.npmjs.org/express/-/express-4.13.4.tgz", + "_shasum": "3c0b76f3c77590c8345739061ec0bd3ba067ec24", "_shrinkwrap": null, - "_spec": "express", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail", + "_spec": "express@~4.13.4", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -84,57 +79,56 @@ } ], "dependencies": { - "accepts": "~1.3.3", + "accepts": "~1.2.12", "array-flatten": "1.1.1", "content-disposition": "0.5.1", - "content-type": "~1.0.2", - "cookie": "0.3.1", + "content-type": "~1.0.1", + "cookie": "0.1.5", "cookie-signature": "1.0.6", "debug": "~2.2.0", "depd": "~1.1.0", - "encodeurl": "~1.0.1", "escape-html": "~1.0.3", "etag": "~1.7.0", - "finalhandler": "0.5.0", + "finalhandler": "0.4.1", "fresh": "0.3.0", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", "parseurl": "~1.3.1", "path-to-regexp": "0.1.7", - "proxy-addr": "~1.1.2", - "qs": "6.2.0", - "range-parser": "~1.2.0", - "send": "0.14.1", - "serve-static": "~1.11.1", - "type-is": "~1.6.13", + "proxy-addr": "~1.0.10", + "qs": "4.0.0", + "range-parser": "~1.0.3", + "send": "0.13.1", + "serve-static": "~1.10.2", + "type-is": "~1.6.6", "utils-merge": "1.0.0", - "vary": "~1.1.0" + "vary": "~1.0.1" }, "description": "Fast, unopinionated, minimalist web framework", "devDependencies": { "after": "0.8.1", - "body-parser": "~1.15.1", + "body-parser": "~1.14.2", "connect-redis": "~2.4.1", - "cookie-parser": "~1.4.3", + "cookie-parser": "~1.4.1", "cookie-session": "~1.2.0", - "ejs": "2.4.2", + "ejs": "2.3.4", "express-session": "~1.13.0", - "istanbul": "0.4.3", + "istanbul": "0.4.2", "jade": "~1.11.0", "marked": "0.3.5", - "method-override": "~2.3.6", - "mocha": "2.5.3", - "morgan": "~1.7.0", + "method-override": "~2.3.5", + "mocha": "2.3.4", + "morgan": "~1.6.1", "multiparty": "~4.1.2", - "should": "9.0.2", - "supertest": "1.2.0", - "vhost": "~3.0.2" + "should": "7.1.1", + "supertest": "1.1.0", + "vhost": "~3.0.1" }, "directories": {}, "dist": { - "shasum": "c1ee3f42cdc891fb3dc650a8922d51ec847d0d66", - "tarball": "https://registry.npmjs.org/express/-/express-4.14.0.tgz" + "shasum": "3c0b76f3c77590c8345739061ec0bd3ba067ec24", + "tarball": "https://registry.npmjs.org/express/-/express-4.13.4.tgz" }, "engines": { "node": ">= 0.10.0" @@ -146,8 +140,8 @@ "index.js", "lib/" ], - "gitHead": "9375a9afa9d7baa814b454c7a6818a7471aaef00", - "homepage": "http://expressjs.com/", + "gitHead": "193bed2649c55c1fd362e46cd4702c773f3e7434", + "homepage": "https://github.com/expressjs/express", "keywords": [ "express", "framework", @@ -164,18 +158,6 @@ { "name": "dougwilson", "email": "doug@somethingdoug.com" - }, - { - "name": "hacksparrow", - "email": "captain@hacksparrow.com" - }, - { - "name": "jasnell", - "email": "jasnell@gmail.com" - }, - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" } ], "name": "express", @@ -191,5 +173,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" }, - "version": "4.14.0" + "version": "4.13.4" } diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md index e7e144c..78dddc0 100644 --- a/node_modules/finalhandler/HISTORY.md +++ b/node_modules/finalhandler/HISTORY.md @@ -1,13 +1,3 @@ -0.5.0 / 2016-06-15 -================== - - * Change invalid or non-numeric status code to 500 - * Overwrite status message to match set status code - * Prefer `err.statusCode` if `err.status` is invalid - * Set response headers from `err.headers` object - * Use `statuses` instead of `http` module for status messages - - Includes all defined status messages - 0.4.1 / 2015-12-02 ================== diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md index 58bf720..6b171d4 100644 --- a/node_modules/finalhandler/README.md +++ b/node_modules/finalhandler/README.md @@ -25,16 +25,7 @@ var finalhandler = require('finalhandler') Returns function to be invoked as the final step for the given `req` and `res`. This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will write out a 404 response to the `res`. If it is truthy, an error response will -be written out to the `res`. - -When an error is written, the following information is added to the response: - - * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If - this value is outside the 4xx or 5xx range, it will be set to 500. - * The `res.statusMessage` is set according to the status code. - * The body will be the HTML of the status code message if `env` is - `'production'`, otherwise will be `err.stack`. - * Any headers specified in an `err.headers` object. +be written out to the `res`, and `res.statusCode` is set from `err.status`. The final handler will also unpipe anything from `req` when it is invoked. @@ -133,7 +124,7 @@ function logerror(err) { [npm-image]: https://img.shields.io/npm/v/finalhandler.svg [npm-url]: https://npmjs.org/package/finalhandler [node-image]: https://img.shields.io/node/v/finalhandler.svg -[node-url]: https://nodejs.org/en/download +[node-url]: http://nodejs.org/download/ [travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg [travis-url]: https://travis-ci.org/pillarjs/finalhandler [coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js index 884d802..0de7c6b 100644 --- a/node_modules/finalhandler/index.js +++ b/node_modules/finalhandler/index.js @@ -13,8 +13,8 @@ var debug = require('debug')('finalhandler') var escapeHtml = require('escape-html') +var http = require('http') var onFinished = require('on-finished') -var statuses = require('statuses') var unpipe = require('unpipe') /** @@ -25,7 +25,7 @@ var unpipe = require('unpipe') /* istanbul ignore next */ var defer = typeof setImmediate === 'function' ? setImmediate - : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } + : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } var isFinished = onFinished.isFinished /** @@ -45,7 +45,7 @@ module.exports = finalhandler * @public */ -function finalhandler (req, res, options) { +function finalhandler(req, res, options) { var opts = options || {} // get environment @@ -55,8 +55,7 @@ function finalhandler (req, res, options) { var onerror = opts.onerror return function (err) { - var headers = Object.create(null) - var status + var status = res.statusCode // ignore 404 on in-flight response if (!err && res._header) { @@ -66,30 +65,28 @@ function finalhandler (req, res, options) { // unhandled error if (err) { - // respect status code from error - status = getErrorStatusCode(err) || res.statusCode + // respect err.statusCode + if (err.statusCode) { + status = err.statusCode + } - // default status code to 500 if outside valid range - if (typeof status !== 'number' || status < 400 || status > 599) { - status = 500 + // respect err.status + if (err.status) { + status = err.status } - // respect err.headers - if (err.headers && (err.status === status || err.statusCode === status)) { - var keys = Object.keys(err.headers) - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - headers[key] = err.headers[key] - } + // default status code to 500 + if (!status || status < 400) { + status = 500 } // production gets a basic error message var msg = env === 'production' - ? statuses[status] + ? http.STATUS_CODES[status] : err.stack || err.toString() msg = escapeHtml(msg) .replace(/\n/g, '
') - .replace(/\x20{2}/g, '  ') + '\n' + .replace(/ /g, '  ') + '\n' } else { status = 404 msg = 'Cannot ' + escapeHtml(req.method) + ' ' + escapeHtml(req.originalUrl || req.url) + '\n' @@ -104,61 +101,26 @@ function finalhandler (req, res, options) { // cannot actually respond if (res._header) { - debug('cannot %d after headers sent', status) - req.socket.destroy() - return + return req.socket.destroy() } - // send response - send(req, res, status, headers, msg) + send(req, res, status, msg) } } -/** - * Get status code from Error object. - * - * @param {Error} err - * @return {number} - * @private - */ - -function getErrorStatusCode (err) { - // check err.status - if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { - return err.status - } - - // check err.statusCode - if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { - return err.statusCode - } - - return undefined -} - /** * Send response. * * @param {IncomingMessage} req * @param {OutgoingMessage} res * @param {number} status - * @param {object} headers * @param {string} body * @private */ -function send (req, res, status, headers, body) { - function write () { - // response status +function send(req, res, status, body) { + function write() { res.statusCode = status - res.statusMessage = statuses[status] - - // response headers - var keys = Object.keys(headers) - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - res.setHeader(key, headers[key]) - } // security header for content sniffing res.setHeader('X-Content-Type-Options', 'nosniff') diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json index 0021816..e9ca8c4 100644 --- a/node_modules/finalhandler/package.json +++ b/node_modules/finalhandler/package.json @@ -2,26 +2,22 @@ "_args": [ [ { - "raw": "finalhandler@0.5.0", + "raw": "finalhandler@0.4.1", "scope": null, "escapedName": "finalhandler", "name": "finalhandler", - "rawSpec": "0.5.0", - "spec": "0.5.0", + "rawSpec": "0.4.1", + "spec": "0.4.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "finalhandler@0.5.0", - "_id": "finalhandler@0.5.0", + "_from": "finalhandler@0.4.1", + "_id": "finalhandler@0.4.1", "_inCache": true, "_installable": true, "_location": "/finalhandler", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/finalhandler-0.5.0.tgz_1466028655505_0.19758180482313037" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -29,22 +25,22 @@ "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "finalhandler@0.5.0", + "raw": "finalhandler@0.4.1", "scope": null, "escapedName": "finalhandler", "name": "finalhandler", - "rawSpec": "0.5.0", - "spec": "0.5.0", + "rawSpec": "0.4.1", + "spec": "0.4.1", "type": "version" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.5.0.tgz", - "_shasum": "e9508abece9b6dba871a6942a1d7911b91911ac7", + "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.1.tgz", + "_shasum": "85a17c6c59a94717d262d61230d4b0ebe3d4a14d", "_shrinkwrap": null, - "_spec": "finalhandler@0.5.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "finalhandler@0.4.1", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" @@ -56,24 +52,19 @@ "debug": "~2.2.0", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "statuses": "~1.3.0", "unpipe": "~1.0.0" }, "description": "Node.js final http responder", "devDependencies": { - "eslint": "2.12.0", - "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.3.2", - "eslint-plugin-standard": "1.3.2", - "istanbul": "0.4.3", - "mocha": "2.5.3", - "readable-stream": "2.1.2", + "istanbul": "0.4.1", + "mocha": "2.3.4", + "readable-stream": "2.0.4", "supertest": "1.1.0" }, "directories": {}, "dist": { - "shasum": "e9508abece9b6dba871a6942a1d7911b91911ac7", - "tarball": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.5.0.tgz" + "shasum": "85a17c6c59a94717d262d61230d4b0ebe3d4a14d", + "tarball": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.1.tgz" }, "engines": { "node": ">= 0.8" @@ -83,13 +74,29 @@ "HISTORY.md", "index.js" ], - "gitHead": "15cc543eb87dd0e2f29e931d86816a6eb348c573", + "gitHead": "ac2036774059eb93dbac8475580e52433204d4d4", "homepage": "https://github.com/pillarjs/finalhandler", "license": "MIT", "maintainers": [ { "name": "dougwilson", "email": "doug@somethingdoug.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" } ], "name": "finalhandler", @@ -100,10 +107,9 @@ "url": "git+https://github.com/pillarjs/finalhandler.git" }, "scripts": { - "lint": "eslint **/*.js", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "version": "0.5.0" + "version": "0.4.1" } diff --git a/node_modules/forwarded/package.json b/node_modules/forwarded/package.json index d248569..13e1e02 100644 --- a/node_modules/forwarded/package.json +++ b/node_modules/forwarded/package.json @@ -10,7 +10,7 @@ "spec": ">=0.1.0 <0.2.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/proxy-addr" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/proxy-addr" ] ], "_from": "forwarded@>=0.1.0 <0.2.0", @@ -40,7 +40,7 @@ "_shasum": "19ef9874c4ae1c297bcf078fde63a09b66a84363", "_shrinkwrap": null, "_spec": "forwarded@~0.1.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/proxy-addr", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/proxy-addr", "bugs": { "url": "https://github.com/jshttp/forwarded/issues" }, diff --git a/node_modules/fresh/package.json b/node_modules/fresh/package.json index 5b4394c..b3dff2e 100644 --- a/node_modules/fresh/package.json +++ b/node_modules/fresh/package.json @@ -10,7 +10,7 @@ "spec": "0.3.0", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "fresh@0.3.0", @@ -35,13 +35,15 @@ }, "_requiredBy": [ "/express", - "/send" + "/send", + "/serve-favicon", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz", "_shasum": "651f838e22424e7566de161d8358caa199f83d4f", "_shrinkwrap": null, "_spec": "fresh@0.3.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca", diff --git a/node_modules/http-errors/package.json b/node_modules/http-errors/package.json index 9ad69be..657b514 100644 --- a/node_modules/http-errors/package.json +++ b/node_modules/http-errors/package.json @@ -10,7 +10,7 @@ "spec": ">=1.5.0 <1.6.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/send" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser" ] ], "_from": "http-errors@>=1.5.0 <1.6.0", @@ -39,13 +39,13 @@ "type": "range" }, "_requiredBy": [ - "/send" + "/body-parser" ], "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.5.0.tgz", "_shasum": "b1cb3d8260fd8e2386cad3189045943372d48211", "_shrinkwrap": null, "_spec": "http-errors@~1.5.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/send", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json index a5c50a2..0671a63 100644 --- a/node_modules/inherits/package.json +++ b/node_modules/inherits/package.json @@ -10,7 +10,7 @@ "spec": "2.0.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/http-errors" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/http-errors" ] ], "_from": "inherits@2.0.1", @@ -34,13 +34,15 @@ "type": "version" }, "_requiredBy": [ - "/http-errors" + "/http-errors", + "/send/http-errors", + "/serve-static/http-errors" ], "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", "_shrinkwrap": null, "_spec": "inherits@2.0.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/http-errors", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/http-errors", "browser": "./inherits_browser.js", "bugs": { "url": "https://github.com/isaacs/inherits/issues" diff --git a/node_modules/ipaddr.js/README.md b/node_modules/ipaddr.js/README.md index bfcb1c9..f4f8776 100644 --- a/node_modules/ipaddr.js/README.md +++ b/node_modules/ipaddr.js/README.md @@ -15,10 +15,6 @@ and convert between IPv4 and IPv4-mapped IPv6 addresses. `npm install ipaddr.js` -or - -`bower install ipaddr.js` - ## API ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, @@ -163,47 +159,3 @@ To access the underlying representation of the address, use `addr.octets`. var addr = ipaddr.parse("192.168.1.1"); addr.octets // => [192, 168, 1, 1] ``` - -`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or -false if the netmask is not valid. - -```js -ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 -ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null -``` - -#### Conversion - -IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. - -The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object -if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, -while for IPv6 it has to be an array of sixteen 8-bit values. - -For example: -```js -var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); -addr.toString(); // => "127.0.0.1" -``` - -or - -```js -var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) -addr.toString(); // => "2001:db8::1" -``` - -Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). - -For example: -```js -var addr = ipaddr.parse("127.0.0.1"); -addr.toByteArray(); // => [0x7f, 0, 0, 1] -``` - -or - -```js -var addr = ipaddr.parse("2001:db8::1"); -addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] -``` diff --git a/node_modules/ipaddr.js/bower.json b/node_modules/ipaddr.js/bower.json index e494f97..bc04ffe 100644 --- a/node_modules/ipaddr.js/bower.json +++ b/node_modules/ipaddr.js/bower.json @@ -1,6 +1,6 @@ { "name": "ipaddr.js", - "version": "1.1.1", + "version": "1.0.5", "homepage": "https://github.com/whitequark/ipaddr.js", "authors": [ "whitequark " diff --git a/node_modules/ipaddr.js/ipaddr.min.js b/node_modules/ipaddr.js/ipaddr.min.js index ffa32ff..ee5179d 100644 --- a/node_modules/ipaddr.js/ipaddr.min.js +++ b/node_modules/ipaddr.js/ipaddr.min.js @@ -1 +1 @@ -(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if(o=n-e,0>o&&(o=0),r[i]>>o!==t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(e in t)for(i=t[e],!i[0]||i[0]instanceof Array||(i=[i]),a=0,s=i.length;s>a;a++)if(o=i[a],r.match.apply(r,o))return e;return n},t.IPv4=function(){function r(r){var t,n,e;if(4!==r.length)throw new Error("ipaddr: ipv4 octet count should be 4");for(n=0,e=r.length;e>n;n++)if(t=r[n],!(t>=0&&255>=t))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=r}return r.prototype.kind=function(){return"ipv4"},r.prototype.toString=function(){return this.octets.join(".")},r.prototype.toByteArray=function(){return this.octets.slice(0)},r.prototype.match=function(r,t){var n;if(void 0===t&&(n=r,r=n[0],t=n[1]),"ipv4"!==r.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return a(this.octets,r.octets,8,t)},r.prototype.SpecialRanges={unspecified:[[new r([0,0,0,0]),8]],broadcast:[[new r([255,255,255,255]),32]],multicast:[[new r([224,0,0,0]),4]],linkLocal:[[new r([169,254,0,0]),16]],loopback:[[new r([127,0,0,0]),8]],"private":[[new r([10,0,0,0]),8],[new r([172,16,0,0]),12],[new r([192,168,0,0]),16]],reserved:[[new r([192,0,0,0]),24],[new r([192,0,2,0]),24],[new r([192,88,99,0]),24],[new r([198,51,100,0]),24],[new r([203,0,113,0]),24],[new r([240,0,0,0]),4]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:"+this.toString())},r.prototype.prefixLengthFromSubnetMask=function(){var r,t,n,e,i,o,a;for(o={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r=0,e=!1,t=a=3;a>=0;t=a+=-1){if(n=this.octets[t],!(n in o))return null;if(i=o[n],e&&0!==i)return null;8!==i&&(e=!0),r+=i}return 32-r},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(o=t.slice(1,6),a=[],r=0,e=o.length;e>r;r++)i=o[r],a.push(n(i));return a}();if(t=r.match(e.longValue)){if(a=n(t[1]),a>4294967295||0>a)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;24>=r;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r){var t,n,e,i,o,a;if(16===r.length)for(this.parts=[],t=e=0;14>=e;t=e+=2)this.parts.push(r[t]<<8|r[t+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(a=this.parts,i=0,o=a.length;o>i;i++)if(n=a[i],!(n>=0&&65535>=n))throw new Error("ipaddr: ipv6 part should fit in 16 bits")}return r.prototype.kind=function(){return"ipv6"},r.prototype.toString=function(){var r,t,n,e,i,o,a;for(i=function(){var r,n,e,i;for(e=this.parts,i=[],r=0,n=e.length;n>r;r++)t=e[r],i.push(t.toString(16));return i}.call(this),r=[],n=function(t){return r.push(t)},e=0,o=0,a=i.length;a>o;o++)switch(t=i[o],e){case 0:n("0"===t?"":t),e=1;break;case 1:"0"===t?e=2:n(t);break;case 2:"0"!==t&&(n(""),n(t),e=3);break;case 3:n(t)}return 2===e&&(n(""),n("")),r.join(":")},r.prototype.toByteArray=function(){var r,t,n,e,i;for(r=[],i=this.parts,n=0,e=i.length;e>n;n++)t=i[n],r.push(t>>8),r.push(255&t);return r},r.prototype.toNormalizedString=function(){var r;return function(){var t,n,e,i;for(e=this.parts,i=[],t=0,n=e.length;n>t;t++)r=e[t],i.push(r.toString(16));return i}.call(this).join(":")},r.prototype.match=function(r,t){var n;if(void 0===t&&(n=r,r=n[0],t=n[1]),"ipv6"!==r.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return a(this.parts,r.parts,16,t)},r.prototype.SpecialRanges={unspecified:[new r([0,0,0,0,0,0,0,0]),128],linkLocal:[new r([65152,0,0,0,0,0,0,0]),10],multicast:[new r([65280,0,0,0,0,0,0,0]),8],loopback:[new r([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new r([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new r([0,0,0,0,0,65535,0,0]),96],rfc6145:[new r([0,0,0,0,65535,0,0,0]),96],rfc6052:[new r([100,65435,0,0,0,0,0,0]),96],"6to4":[new r([8194,0,0,0,0,0,0,0]),16],teredo:[new r([8193,0,0,0,0,0,0,0]),32],reserved:[[new r([8193,3512,0,0,0,0,0,0]),32]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},r.prototype.toIPv4Address=function(){var r,n,e;if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");return e=this.parts.slice(-2),r=e[0],n=e[1],new t.IPv4([r>>8,255&r,n>>8,255&n])},r}(),i="(?:[0-9a-f]+::?)+",o={"native":new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+(""+n+"\\."+n+"\\."+n+"\\."+n+"$"),"i")},r=function(r,t){var n,e,i,o,a;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for(n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(a=t-n,o=":";a--;)o+="0:";return r=r.replace("::",o),":"===r[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),function(){var t,n,e,o;for(e=r.split(":"),o=[],t=0,n=e.length;n>t;t++)i=e[t],o.push(parseInt(i,16));return o}()},t.IPv6.parser=function(t){var n,e,i,a,s,p;if(t.match(o["native"]))return r(t,8);if((n=t.match(o.transitional))&&(a=r(n[1].slice(0,-1),6))){for(i=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])],s=0,p=i.length;p>s;s++)if(e=i[s],!(e>=0&&255>=e))return null;return a.push(i[0]<<8|i[1]),a.push(i[2]<<8|i[3]),a}return null},t.IPv4.isIPv4=t.IPv6.isIPv6=function(r){return null!==this.parser(r)},t.IPv4.isValid=function(r){var t;try{return new this(this.parser(r)),!0}catch(n){return t=n,!1}},t.IPv6.isValid=function(r){var t;if("string"==typeof r&&-1===r.indexOf(":"))return!1;try{return new this(this.parser(r)),!0}catch(n){return t=n,!1}},t.IPv4.parse=t.IPv6.parse=function(r){var t;if(t=this.parser(r),null===t)throw new Error("ipaddr: string is not formatted like ip address");return new this(t)},t.IPv4.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&32>=t))return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv6.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&128>=t))return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){var n;try{return t.IPv6.parseCIDR(r)}catch(e){n=e;try{return t.IPv4.parseCIDR(r)}catch(e){throw n=e,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var n;if(n=r.length,4===n)return new t.IPv4(r);if(16===n)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file +(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if(o=n-e,0>o&&(o=0),r[i]>>o!==t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(e in t)for(i=t[e],!i[0]||i[0]instanceof Array||(i=[i]),a=0,s=i.length;s>a;a++)if(o=i[a],r.match.apply(r,o))return e;return n},t.IPv4=function(){function r(r){var t,n,e;if(4!==r.length)throw new Error("ipaddr: ipv4 octet count should be 4");for(n=0,e=r.length;e>n;n++)if(t=r[n],!(t>=0&&255>=t))throw new Error("ipaddr: ipv4 octet is a byte");this.octets=r}return r.prototype.kind=function(){return"ipv4"},r.prototype.toString=function(){return this.octets.join(".")},r.prototype.toByteArray=function(){return this.octets.slice(0)},r.prototype.match=function(r,t){var n;if(void 0===t&&(n=r,r=n[0],t=n[1]),"ipv4"!==r.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return a(this.octets,r.octets,8,t)},r.prototype.SpecialRanges={unspecified:[[new r([0,0,0,0]),8]],broadcast:[[new r([255,255,255,255]),32]],multicast:[[new r([224,0,0,0]),4]],linkLocal:[[new r([169,254,0,0]),16]],loopback:[[new r([127,0,0,0]),8]],"private":[[new r([10,0,0,0]),8],[new r([172,16,0,0]),12],[new r([192,168,0,0]),16]],reserved:[[new r([192,0,0,0]),24],[new r([192,0,2,0]),24],[new r([192,88,99,0]),24],[new r([198,51,100,0]),24],[new r([203,0,113,0]),24],[new r([240,0,0,0]),4]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:"+this.toString())},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(o=t.slice(1,6),a=[],r=0,e=o.length;e>r;r++)i=o[r],a.push(n(i));return a}();if(t=r.match(e.longValue)){if(a=n(t[1]),a>4294967295||0>a)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;24>=r;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r){var t,n,e;if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8");for(n=0,e=r.length;e>n;n++)if(t=r[n],!(t>=0&&65535>=t))throw new Error("ipaddr: ipv6 part should fit to two octets");this.parts=r}return r.prototype.kind=function(){return"ipv6"},r.prototype.toString=function(){var r,t,n,e,i,o,a;for(i=function(){var r,n,e,i;for(e=this.parts,i=[],r=0,n=e.length;n>r;r++)t=e[r],i.push(t.toString(16));return i}.call(this),r=[],n=function(t){return r.push(t)},e=0,o=0,a=i.length;a>o;o++)switch(t=i[o],e){case 0:n("0"===t?"":t),e=1;break;case 1:"0"===t?e=2:n(t);break;case 2:"0"!==t&&(n(""),n(t),e=3);break;case 3:n(t)}return 2===e&&(n(""),n("")),r.join(":")},r.prototype.toByteArray=function(){var r,t,n,e,i;for(r=[],i=this.parts,n=0,e=i.length;e>n;n++)t=i[n],r.push(t>>8),r.push(255&t);return r},r.prototype.toNormalizedString=function(){var r;return function(){var t,n,e,i;for(e=this.parts,i=[],t=0,n=e.length;n>t;t++)r=e[t],i.push(r.toString(16));return i}.call(this).join(":")},r.prototype.match=function(r,t){var n;if(void 0===t&&(n=r,r=n[0],t=n[1]),"ipv6"!==r.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return a(this.parts,r.parts,16,t)},r.prototype.SpecialRanges={unspecified:[new r([0,0,0,0,0,0,0,0]),128],linkLocal:[new r([65152,0,0,0,0,0,0,0]),10],multicast:[new r([65280,0,0,0,0,0,0,0]),8],loopback:[new r([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new r([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new r([0,0,0,0,0,65535,0,0]),96],rfc6145:[new r([0,0,0,0,65535,0,0,0]),96],rfc6052:[new r([100,65435,0,0,0,0,0,0]),96],"6to4":[new r([8194,0,0,0,0,0,0,0]),16],teredo:[new r([8193,0,0,0,0,0,0,0]),32],reserved:[[new r([8193,3512,0,0,0,0,0,0]),32]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},r.prototype.toIPv4Address=function(){var r,n,e;if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");return e=this.parts.slice(-2),r=e[0],n=e[1],new t.IPv4([r>>8,255&r,n>>8,255&n])},r}(),i="(?:[0-9a-f]+::?)+",o={"native":new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+(""+n+"\\."+n+"\\."+n+"\\."+n+"$"),"i")},r=function(r,t){var n,e,i,o,a;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for(n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(a=t-n,o=":";a--;)o+="0:";return r=r.replace("::",o),":"===r[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),function(){var t,n,e,o;for(e=r.split(":"),o=[],t=0,n=e.length;n>t;t++)i=e[t],o.push(parseInt(i,16));return o}()},t.IPv6.parser=function(t){var n,e;return t.match(o["native"])?r(t,8):(n=t.match(o.transitional))&&(e=r(n[1].slice(0,-1),6))?(e.push(parseInt(n[2])<<8|parseInt(n[3])),e.push(parseInt(n[4])<<8|parseInt(n[5])),e):null},t.IPv4.isIPv4=t.IPv6.isIPv6=function(r){return null!==this.parser(r)},t.IPv4.isValid=function(r){var t;try{return new this(this.parser(r)),!0}catch(n){return t=n,!1}},t.IPv6.isValid=function(r){var t;if("string"==typeof r&&-1===r.indexOf(":"))return!1;try{return new this(this.parser(r)),!0}catch(n){return t=n,!1}},t.IPv4.parse=t.IPv6.parse=function(r){var t;if(t=this.parser(r),null===t)throw new Error("ipaddr: string is not formatted like ip address");return new this(t)},t.IPv4.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&32>=t))return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv6.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&128>=t))return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){var n;try{return t.IPv6.parseCIDR(r)}catch(e){n=e;try{return t.IPv4.parseCIDR(r)}catch(e){throw n=e,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file diff --git a/node_modules/ipaddr.js/lib/ipaddr.js b/node_modules/ipaddr.js/lib/ipaddr.js index 36774e7..ef179b4 100644 --- a/node_modules/ipaddr.js/lib/ipaddr.js +++ b/node_modules/ipaddr.js/lib/ipaddr.js @@ -60,7 +60,7 @@ for (_i = 0, _len = octets.length; _i < _len; _i++) { octet = octets[_i]; if (!((0 <= octet && octet <= 255))) { - throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); + throw new Error("ipaddr: ipv4 octet is a byte"); } } this.octets = octets; @@ -107,39 +107,6 @@ return ipaddr.IPv6.parse("::ffff:" + (this.toString())); }; - IPv4.prototype.prefixLengthFromSubnetMask = function() { - var cidr, i, octet, stop, zeros, zerotable, _i; - zerotable = { - 0: 8, - 128: 7, - 192: 6, - 224: 5, - 240: 4, - 248: 3, - 252: 2, - 254: 1, - 255: 0 - }; - cidr = 0; - stop = false; - for (i = _i = 3; _i >= 0; i = _i += -1) { - octet = this.octets[i]; - if (octet in zerotable) { - zeros = zerotable[octet]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 8) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 32 - cidr; - }; - return IPv4; })(); @@ -191,24 +158,17 @@ ipaddr.IPv6 = (function() { function IPv6(parts) { - var i, part, _i, _j, _len, _ref; - if (parts.length === 16) { - this.parts = []; - for (i = _i = 0; _i <= 14; i = _i += 2) { - this.parts.push((parts[i] << 8) | parts[i + 1]); - } - } else if (parts.length === 8) { - this.parts = parts; - } else { - throw new Error("ipaddr: ipv6 part count should be 8 or 16"); + var part, _i, _len; + if (parts.length !== 8) { + throw new Error("ipaddr: ipv6 part count should be 8"); } - _ref = this.parts; - for (_j = 0, _len = _ref.length; _j < _len; _j++) { - part = _ref[_j]; + for (_i = 0, _len = parts.length; _i < _len; _i++) { + part = parts[_i]; if (!((0 <= part && part <= 0xffff))) { - throw new Error("ipaddr: ipv6 part should fit in 16 bits"); + throw new Error("ipaddr: ipv6 part should fit to two octets"); } } + this.parts = parts; } IPv6.prototype.kind = function() { @@ -391,21 +351,14 @@ }; ipaddr.IPv6.parser = function(string) { - var match, octet, octets, parts, _i, _len; + var match, parts; if (string.match(ipv6Regexes['native'])) { return expandIPv6(string, 8); } else if (match = string.match(ipv6Regexes['transitional'])) { parts = expandIPv6(match[1].slice(0, -1), 6); if (parts) { - octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; - for (_i = 0, _len = octets.length; _i < _len; _i++) { - octet = octets[_i]; - if (!((0 <= octet && octet <= 255))) { - return null; - } - } - parts.push(octets[0] << 8 | octets[1]); - parts.push(octets[2] << 8 | octets[3]); + parts.push(parseInt(match[2]) << 8 | parseInt(match[3])); + parts.push(parseInt(match[4]) << 8 | parseInt(match[5])); return parts; } } @@ -501,18 +454,6 @@ } }; - ipaddr.fromByteArray = function(bytes) { - var length; - length = bytes.length; - if (length === 4) { - return new ipaddr.IPv4(bytes); - } else if (length === 16) { - return new ipaddr.IPv6(bytes); - } else { - throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); - } - }; - ipaddr.process = function(string) { var addr; addr = this.parse(string); diff --git a/node_modules/ipaddr.js/package.json b/node_modules/ipaddr.js/package.json index ed2475f..b226765 100644 --- a/node_modules/ipaddr.js/package.json +++ b/node_modules/ipaddr.js/package.json @@ -2,26 +2,22 @@ "_args": [ [ { - "raw": "ipaddr.js@1.1.1", + "raw": "ipaddr.js@1.0.5", "scope": null, "escapedName": "ipaddr.js", "name": "ipaddr.js", - "rawSpec": "1.1.1", - "spec": "1.1.1", + "rawSpec": "1.0.5", + "spec": "1.0.5", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/proxy-addr" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/proxy-addr" ] ], - "_from": "ipaddr.js@1.1.1", - "_id": "ipaddr.js@1.1.1", + "_from": "ipaddr.js@1.0.5", + "_id": "ipaddr.js@1.0.5", "_inCache": true, "_installable": true, "_location": "/ipaddr.js", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/ipaddr.js-1.1.1.tgz_1464074293475_0.6683731523808092" - }, "_npmUser": { "name": "whitequark", "email": "whitequark@whitequark.org" @@ -29,22 +25,22 @@ "_npmVersion": "1.4.21", "_phantomChildren": {}, "_requested": { - "raw": "ipaddr.js@1.1.1", + "raw": "ipaddr.js@1.0.5", "scope": null, "escapedName": "ipaddr.js", "name": "ipaddr.js", - "rawSpec": "1.1.1", - "spec": "1.1.1", + "rawSpec": "1.0.5", + "spec": "1.0.5", "type": "version" }, "_requiredBy": [ "/proxy-addr" ], - "_resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.1.1.tgz", - "_shasum": "c791d95f52b29c1247d5df80ada39b8a73647230", + "_resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz", + "_shasum": "5fa78cf301b825c78abc3042d812723049ea23c7", "_shrinkwrap": null, - "_spec": "ipaddr.js@1.1.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/proxy-addr", + "_spec": "ipaddr.js@1.0.5", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/proxy-addr", "author": { "name": "whitequark", "email": "whitequark@whitequark.org" @@ -63,13 +59,13 @@ "lib": "./lib" }, "dist": { - "shasum": "c791d95f52b29c1247d5df80ada39b8a73647230", - "tarball": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.1.1.tgz" + "shasum": "5fa78cf301b825c78abc3042d812723049ea23c7", + "tarball": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz" }, "engines": { "node": ">= 0.10" }, - "gitHead": "dbc7d98bc0d8fff68a894be0c60721566807e2fc", + "gitHead": "46438c8bfa187505b7007a277f09a4a9e73d5686", "homepage": "https://github.com/whitequark/ipaddr.js#readme", "keywords": [ "ip", @@ -94,5 +90,5 @@ "scripts": { "test": "cake build test" }, - "version": "1.1.1" + "version": "1.0.5" } diff --git a/node_modules/ipaddr.js/src/ipaddr.coffee b/node_modules/ipaddr.js/src/ipaddr.coffee index d2abf91..550174f 100644 --- a/node_modules/ipaddr.js/src/ipaddr.coffee +++ b/node_modules/ipaddr.js/src/ipaddr.coffee @@ -41,8 +41,7 @@ ipaddr.subnetMatch = (address, rangeList, defaultName='unicast') -> # An IPv4 address (RFC791). class ipaddr.IPv4 - # Constructs a new IPv4 address from an array of four octets - # in network order (MSB first) + # Constructs a new IPv4 address from an array of four octets. # Verifies the input. constructor: (octets) -> if octets.length != 4 @@ -50,7 +49,7 @@ class ipaddr.IPv4 for octet in octets if !(0 <= octet <= 255) - throw new Error "ipaddr: ipv4 octet should fit in 8 bits" + throw new Error "ipaddr: ipv4 octet is a byte" @octets = octets @@ -62,7 +61,7 @@ class ipaddr.IPv4 toString: -> return @octets.join "." - # Returns an array of byte-sized values in network order (MSB first) + # Returns an array of byte-sized values in network order toByteArray: -> return @octets.slice(0) # octets.clone @@ -115,38 +114,6 @@ class ipaddr.IPv4 toIPv4MappedAddress: -> return ipaddr.IPv6.parse "::ffff:#{@toString()}" - # returns a number of leading ones in IPv4 address, making sure that - # the rest is a solid sequence of 0's (valid netmask) - # returns either the CIDR length or null if mask is not valid - prefixLengthFromSubnetMask: -> - # number of zeroes in octet - zerotable = - 0: 8 - 128: 7 - 192: 6 - 224: 5 - 240: 4 - 248: 3 - 252: 2 - 254: 1 - 255: 0 - - cidr = 0 - # non-zero encountered stop scanning for zeroes - stop = false - for i in [3..0] by -1 - octet = @octets[i] - if octet of zerotable - zeros = zerotable[octet] - if stop and zeros != 0 - return null - unless zeros == 8 - stop = true - cidr += zeros - else - return null - return 32 - cidr - # A list of regular expressions that match arbitrary IPv4 addresses, # for which a number of weird notations exist. # Note that an address like 0010.0xa5.1.1 is considered legal. @@ -178,22 +145,17 @@ ipaddr.IPv4.parser = (string) -> # An IPv6 address (RFC2460) class ipaddr.IPv6 - # Constructs an IPv6 address from an array of eight 16-bit parts - # or sixteen 8-bit parts in network order (MSB first). + # Constructs an IPv6 address from an array of eight 16-bit parts. # Throws an error if the input is invalid. constructor: (parts) -> - if parts.length == 16 - @parts = [] - for i in [0..14] by 2 - @parts.push((parts[i] << 8) | parts[i + 1]) - else if parts.length == 8 - @parts = parts - else - throw new Error "ipaddr: ipv6 part count should be 8 or 16" + if parts.length != 8 + throw new Error "ipaddr: ipv6 part count should be 8" - for part in @parts + for part in parts if !(0 <= part <= 0xffff) - throw new Error "ipaddr: ipv6 part should fit in 16 bits" + throw new Error "ipaddr: ipv6 part should fit to two octets" + + @parts = parts # The 'kind' method exists on both IPv4 and IPv6 classes. kind: -> @@ -236,7 +198,7 @@ class ipaddr.IPv6 return compactStringParts.join ":" - # Returns an array of byte-sized values in network order (MSB first) + # Returns an array of byte-sized values in network order toByteArray: -> bytes = [] for part in @parts @@ -348,14 +310,8 @@ ipaddr.IPv6.parser = (string) -> else if match = string.match(ipv6Regexes['transitional']) parts = expandIPv6(match[1][0..-2], 6) if parts - octets = [parseInt(match[2]), parseInt(match[3]), - parseInt(match[4]), parseInt(match[5])] - for octet in octets - if !(0 <= octet <= 255) - return null - - parts.push(octets[0] << 8 | octets[1]) - parts.push(octets[2] << 8 | octets[3]) + parts.push(parseInt(match[2]) << 8 | parseInt(match[3])) + parts.push(parseInt(match[4]) << 8 | parseInt(match[5])) return parts return null @@ -431,16 +387,6 @@ ipaddr.parseCIDR = (string) -> catch e throw new Error "ipaddr: the address has neither IPv6 nor IPv4 CIDR format" -# Try to parse an array in network order (MSB first) for IPv4 and IPv6 -ipaddr.fromByteArray = (bytes) -> - length = bytes.length - if length == 4 - return new ipaddr.IPv4(bytes) - else if length == 16 - return new ipaddr.IPv6(bytes) - else - throw new Error "ipaddr: the binary input is neither an IPv6 nor IPv4 address" - # Parse an address and return plain IPv4 address if it is an IPv4-mapped address ipaddr.process = (string) -> addr = @parse(string) diff --git a/node_modules/ipaddr.js/test/ipaddr.test.coffee b/node_modules/ipaddr.js/test/ipaddr.test.coffee index 5f07526..17739e2 100644 --- a/node_modules/ipaddr.js/test/ipaddr.test.coffee +++ b/node_modules/ipaddr.js/test/ipaddr.test.coffee @@ -106,25 +106,16 @@ module.exports = test.equal(ipaddr.IPv4.parse('8.8.8.8').range(), 'unicast') test.done() - 'can construct IPv6 from 16bit parts': (test) -> + 'can construct IPv6 from parts': (test) -> test.doesNotThrow -> new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) test.done() - 'can construct IPv6 from 8bit parts': (test) -> - test.doesNotThrow -> - new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) - test.deepEqual(new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), - new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1])) - test.done() - 'refuses to construct invalid IPv6': (test) -> test.throws -> new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 0, 1]) test.throws -> new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 1]) - test.throws -> - new ipaddr.IPv6([0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) test.done() 'converts IPv6 to string correctly': (test) -> @@ -149,7 +140,7 @@ module.exports = test.equal(ipaddr.IPv6.isIPv6('2001:db8:F53A::1'), true) test.equal(ipaddr.IPv6.isIPv6('200001::1'), true) test.equal(ipaddr.IPv6.isIPv6('::ffff:192.168.1.1'), true) - test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1'), false) + test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1'), true) test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1:0'), false) test.equal(ipaddr.IPv6.isIPv6('fe80::wtf'), false) test.done() @@ -160,7 +151,6 @@ module.exports = test.equal(ipaddr.IPv6.isValid('::ffff:192.168.1.1'), true) test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1'), false) test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1:0'), false) - test.equal(ipaddr.IPv6.isValid('::ffff:222.1.41.9000'), false) test.equal(ipaddr.IPv6.isValid('2001:db8::F53A::1'), false) test.equal(ipaddr.IPv6.isValid('fe80::wtf'), false) test.equal(ipaddr.IPv6.isValid('2002::2:'), false) @@ -290,50 +280,3 @@ module.exports = test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false), false) test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false), false) test.done() - - 'is able to determine IP address type from byte array input': (test) -> - test.equal(ipaddr.fromByteArray([0x7f, 0, 0, 1]).kind(), 'ipv4') - test.equal(ipaddr.fromByteArray([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]).kind(), 'ipv6') - test.throws -> - ipaddr.fromByteArray([1]) - test.done() - - 'prefixLengthFromSubnetMask returns proper CIDR notation for standard IPv4 masks': (test) -> - test.equal(ipaddr.IPv4.parse('255.255.255.255').prefixLengthFromSubnetMask(), 32) - test.equal(ipaddr.IPv4.parse('255.255.255.254').prefixLengthFromSubnetMask(), 31) - test.equal(ipaddr.IPv4.parse('255.255.255.252').prefixLengthFromSubnetMask(), 30) - test.equal(ipaddr.IPv4.parse('255.255.255.248').prefixLengthFromSubnetMask(), 29) - test.equal(ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask(), 28) - test.equal(ipaddr.IPv4.parse('255.255.255.224').prefixLengthFromSubnetMask(), 27) - test.equal(ipaddr.IPv4.parse('255.255.255.192').prefixLengthFromSubnetMask(), 26) - test.equal(ipaddr.IPv4.parse('255.255.255.128').prefixLengthFromSubnetMask(), 25) - test.equal(ipaddr.IPv4.parse('255.255.255.0').prefixLengthFromSubnetMask(), 24) - test.equal(ipaddr.IPv4.parse('255.255.254.0').prefixLengthFromSubnetMask(), 23) - test.equal(ipaddr.IPv4.parse('255.255.252.0').prefixLengthFromSubnetMask(), 22) - test.equal(ipaddr.IPv4.parse('255.255.248.0').prefixLengthFromSubnetMask(), 21) - test.equal(ipaddr.IPv4.parse('255.255.240.0').prefixLengthFromSubnetMask(), 20) - test.equal(ipaddr.IPv4.parse('255.255.224.0').prefixLengthFromSubnetMask(), 19) - test.equal(ipaddr.IPv4.parse('255.255.192.0').prefixLengthFromSubnetMask(), 18) - test.equal(ipaddr.IPv4.parse('255.255.128.0').prefixLengthFromSubnetMask(), 17) - test.equal(ipaddr.IPv4.parse('255.255.0.0').prefixLengthFromSubnetMask(), 16) - test.equal(ipaddr.IPv4.parse('255.254.0.0').prefixLengthFromSubnetMask(), 15) - test.equal(ipaddr.IPv4.parse('255.252.0.0').prefixLengthFromSubnetMask(), 14) - test.equal(ipaddr.IPv4.parse('255.248.0.0').prefixLengthFromSubnetMask(), 13) - test.equal(ipaddr.IPv4.parse('255.240.0.0').prefixLengthFromSubnetMask(), 12) - test.equal(ipaddr.IPv4.parse('255.224.0.0').prefixLengthFromSubnetMask(), 11) - test.equal(ipaddr.IPv4.parse('255.192.0.0').prefixLengthFromSubnetMask(), 10) - test.equal(ipaddr.IPv4.parse('255.128.0.0').prefixLengthFromSubnetMask(), 9) - test.equal(ipaddr.IPv4.parse('255.0.0.0').prefixLengthFromSubnetMask(), 8) - test.equal(ipaddr.IPv4.parse('254.0.0.0').prefixLengthFromSubnetMask(), 7) - test.equal(ipaddr.IPv4.parse('252.0.0.0').prefixLengthFromSubnetMask(), 6) - test.equal(ipaddr.IPv4.parse('248.0.0.0').prefixLengthFromSubnetMask(), 5) - test.equal(ipaddr.IPv4.parse('240.0.0.0').prefixLengthFromSubnetMask(), 4) - test.equal(ipaddr.IPv4.parse('224.0.0.0').prefixLengthFromSubnetMask(), 3) - test.equal(ipaddr.IPv4.parse('192.0.0.0').prefixLengthFromSubnetMask(), 2) - test.equal(ipaddr.IPv4.parse('128.0.0.0').prefixLengthFromSubnetMask(), 1) - test.equal(ipaddr.IPv4.parse('0.0.0.0').prefixLengthFromSubnetMask(), 0) - # negative cases - test.equal(ipaddr.IPv4.parse('192.168.255.0').prefixLengthFromSubnetMask(), null) - test.equal(ipaddr.IPv4.parse('255.0.255.0').prefixLengthFromSubnetMask(), null) - test.done() - diff --git a/node_modules/media-typer/package.json b/node_modules/media-typer/package.json index ad9993c..a28b670 100644 --- a/node_modules/media-typer/package.json +++ b/node_modules/media-typer/package.json @@ -10,7 +10,7 @@ "spec": "0.3.0", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/type-is" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/type-is" ] ], "_from": "media-typer@0.3.0", @@ -40,7 +40,7 @@ "_shasum": "8710d7af0aa626f8fffa1ce00168545263255748", "_shrinkwrap": null, "_spec": "media-typer@0.3.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/type-is", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/type-is", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" diff --git a/node_modules/merge-descriptors/package.json b/node_modules/merge-descriptors/package.json index 123aa06..af239a6 100644 --- a/node_modules/merge-descriptors/package.json +++ b/node_modules/merge-descriptors/package.json @@ -10,7 +10,7 @@ "spec": "1.0.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "merge-descriptors@1.0.1", @@ -40,7 +40,7 @@ "_shasum": "b00aaa556dd8b44568150ec9d1b953f3f90cbb61", "_shrinkwrap": null, "_spec": "merge-descriptors@1.0.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", diff --git a/node_modules/methods/package.json b/node_modules/methods/package.json index 0f8c680..60f8be6 100644 --- a/node_modules/methods/package.json +++ b/node_modules/methods/package.json @@ -10,7 +10,7 @@ "spec": ">=1.1.2 <1.2.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "methods@>=1.1.2 <1.2.0", @@ -40,7 +40,7 @@ "_shasum": "5529a4d67654134edcc5266656835b0f851afcee", "_shrinkwrap": null, "_spec": "methods@~1.1.2", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "browser": { "http": false }, diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json index 891038a..6bc4b9d 100644 --- a/node_modules/mime-db/package.json +++ b/node_modules/mime-db/package.json @@ -10,7 +10,7 @@ "spec": ">=1.24.0 <1.25.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/mime-types" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/mime-types" ] ], "_from": "mime-db@>=1.24.0 <1.25.0", @@ -45,7 +45,7 @@ "_shasum": "e2d13f939f0016c6e4e9ad25a8652f126c467f0c", "_shrinkwrap": null, "_spec": "mime-db@~1.24.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/mime-types", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/mime-types", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json index aa84e0f..cae8ce1 100644 --- a/node_modules/mime-types/package.json +++ b/node_modules/mime-types/package.json @@ -10,7 +10,7 @@ "spec": ">=2.1.11 <2.2.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/accepts" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/type-is" ] ], "_from": "mime-types@>=2.1.11 <2.2.0", @@ -46,7 +46,7 @@ "_shasum": "152ba256777020dd4663f54c2e7bc26381e71729", "_shrinkwrap": null, "_spec": "mime-types@~2.1.11", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/accepts", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/type-is", "bugs": { "url": "https://github.com/jshttp/mime-types/issues" }, diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json index ade4847..a76efad 100644 --- a/node_modules/mime/package.json +++ b/node_modules/mime/package.json @@ -10,7 +10,7 @@ "spec": "1.3.4", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/send" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/send" ] ], "_from": "mime@1.3.4", @@ -34,13 +34,14 @@ "type": "version" }, "_requiredBy": [ - "/send" + "/send", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "_shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53", "_shrinkwrap": null, "_spec": "mime@1.3.4", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/send", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/send", "author": { "name": "Robert Kieffer", "email": "robert@broofa.com", diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json index bc6b2eb..b0ab347 100644 --- a/node_modules/ms/package.json +++ b/node_modules/ms/package.json @@ -10,7 +10,7 @@ "spec": "0.7.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/debug" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/debug" ] ], "_from": "ms@0.7.1", @@ -36,13 +36,15 @@ }, "_requiredBy": [ "/debug", - "/send" + "/send", + "/serve-favicon", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", "_shrinkwrap": null, "_spec": "ms@0.7.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/debug", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/debug", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, diff --git a/node_modules/negotiator/HISTORY.md b/node_modules/negotiator/HISTORY.md index 10b6917..aa2a7c4 100644 --- a/node_modules/negotiator/HISTORY.md +++ b/node_modules/negotiator/HISTORY.md @@ -1,25 +1,3 @@ -0.6.1 / 2016-05-02 -================== - - * perf: improve `Accept` parsing speed - * perf: improve `Accept-Charset` parsing speed - * perf: improve `Accept-Encoding` parsing speed - * perf: improve `Accept-Language` parsing speed - -0.6.0 / 2015-09-29 -================== - - * Fix including type extensions in parameters in `Accept` parsing - * Fix parsing `Accept` parameters with quoted equals - * Fix parsing `Accept` parameters with quoted semicolons - * Lazy-load modules from main entry point - * perf: delay type concatenation until needed - * perf: enable strict mode - * perf: hoist regular expressions - * perf: remove closures getting spec properties - * perf: remove a closure from media type parsing - * perf: remove property delete from media type parsing - 0.5.3 / 2015-05-10 ================== diff --git a/node_modules/negotiator/README.md b/node_modules/negotiator/README.md index 04a67ff..ef507fa 100644 --- a/node_modules/negotiator/README.md +++ b/node_modules/negotiator/README.md @@ -66,7 +66,7 @@ available media types. ```js negotiator = new Negotiator(request) -availableLanguages = ['en', 'es', 'fr'] +availableLanguages = 'en', 'es', 'fr' // Let's say Accept-Language header is 'en;q=0.8, es, pt' @@ -194,7 +194,7 @@ and more. [npm-image]: https://img.shields.io/npm/v/negotiator.svg [npm-url]: https://npmjs.org/package/negotiator [node-version-image]: https://img.shields.io/node/v/negotiator.svg -[node-version-url]: https://nodejs.org/en/download/ +[node-version-url]: http://nodejs.org/download/ [travis-image]: https://img.shields.io/travis/jshttp/negotiator/master.svg [travis-url]: https://travis-ci.org/jshttp/negotiator [coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg diff --git a/node_modules/negotiator/index.js b/node_modules/negotiator/index.js index 8d4f6a2..edae9cf 100644 --- a/node_modules/negotiator/index.js +++ b/node_modules/negotiator/index.js @@ -1,33 +1,11 @@ -/*! - * negotiator - * Copyright(c) 2012 Federico Romero - * Copyright(c) 2012-2014 Isaac Z. Schlueter - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ -'use strict'; - -/** - * Cached loaded submodules. - * @private - */ - -var modules = Object.create(null); - -/** - * Module exports. - * @public - */ +var preferredCharsets = require('./lib/charset'); +var preferredEncodings = require('./lib/encoding'); +var preferredLanguages = require('./lib/language'); +var preferredMediaTypes = require('./lib/mediaType'); module.exports = Negotiator; -module.exports.Negotiator = Negotiator; - -/** - * Create a Negotiator instance from a request. - * @param {object} request - * @public - */ +Negotiator.Negotiator = Negotiator; function Negotiator(request) { if (!(this instanceof Negotiator)) { @@ -43,7 +21,6 @@ Negotiator.prototype.charset = function charset(available) { }; Negotiator.prototype.charsets = function charsets(available) { - var preferredCharsets = loadModule('charset').preferredCharsets; return preferredCharsets(this.request.headers['accept-charset'], available); }; @@ -53,7 +30,6 @@ Negotiator.prototype.encoding = function encoding(available) { }; Negotiator.prototype.encodings = function encodings(available) { - var preferredEncodings = loadModule('encoding').preferredEncodings; return preferredEncodings(this.request.headers['accept-encoding'], available); }; @@ -63,7 +39,6 @@ Negotiator.prototype.language = function language(available) { }; Negotiator.prototype.languages = function languages(available) { - var preferredLanguages = loadModule('language').preferredLanguages; return preferredLanguages(this.request.headers['accept-language'], available); }; @@ -73,7 +48,6 @@ Negotiator.prototype.mediaType = function mediaType(available) { }; Negotiator.prototype.mediaTypes = function mediaTypes(available) { - var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes; return preferredMediaTypes(this.request.headers.accept, available); }; @@ -86,39 +60,3 @@ Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; - -/** - * Load the given module. - * @private - */ - -function loadModule(moduleName) { - var module = modules[moduleName]; - - if (module !== undefined) { - return module; - } - - // This uses a switch for static require analysis - switch (moduleName) { - case 'charset': - module = require('./lib/charset'); - break; - case 'encoding': - module = require('./lib/encoding'); - break; - case 'language': - module = require('./lib/language'); - break; - case 'mediaType': - module = require('./lib/mediaType'); - break; - default: - throw new Error('Cannot find module \'' + moduleName + '\''); - } - - // Store to prevent invoking require() - modules[moduleName] = module; - - return module; -} diff --git a/node_modules/negotiator/lib/charset.js b/node_modules/negotiator/lib/charset.js index ac4217b..7abd17c 100644 --- a/node_modules/negotiator/lib/charset.js +++ b/node_modules/negotiator/lib/charset.js @@ -1,32 +1,5 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - module.exports = preferredCharsets; -module.exports.preferredCharsets = preferredCharsets; - -/** - * Module variables. - * @private - */ - -var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; - -/** - * Parse the Accept-Charset header. - * @private - */ +preferredCharsets.preferredCharsets = preferredCharsets; function parseAcceptCharset(accept) { var accepts = accept.split(','); @@ -45,13 +18,8 @@ function parseAcceptCharset(accept) { return accepts; } -/** - * Parse a charset from the Accept-Charset header. - * @private - */ - -function parseCharset(str, i) { - var match = simpleCharsetRegExp.exec(str); +function parseCharset(s, i) { + var match = s.match(/^\s*(\S+?)\s*(?:;(.*))?$/); if (!match) return null; var charset = match[1]; @@ -74,11 +42,6 @@ function parseCharset(str, i) { }; } -/** - * Get the priority of a charset. - * @private - */ - function getCharsetPriority(charset, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -93,11 +56,6 @@ function getCharsetPriority(charset, accepted, index) { return priority; } -/** - * Get the specificity of the charset. - * @private - */ - function specify(charset, spec, index) { var s = 0; if(spec.charset.toLowerCase() === charset.toLowerCase()){ @@ -114,21 +72,15 @@ function specify(charset, spec, index) { } } -/** - * Get the preferred charsets from an Accept-Charset header. - * @public - */ - function preferredCharsets(accept, provided) { // RFC 2616 sec 14.2: no header = * var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all charsets - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullCharset); + return accepts.filter(isQuality).sort(compareSpecs).map(function getCharset(spec) { + return spec.charset; + }); } var priorities = provided.map(function getPriority(type, index) { @@ -141,29 +93,10 @@ function preferredCharsets(accept, provided) { }); } -/** - * Compare two specs. - * @private - */ - function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } -/** - * Get full charset string. - * @private - */ - -function getFullCharset(spec) { - return spec.charset; -} - -/** - * Check if a spec has any quality. - * @private - */ - function isQuality(spec) { return spec.q > 0; } diff --git a/node_modules/negotiator/lib/encoding.js b/node_modules/negotiator/lib/encoding.js index 70ac3de..7fed673 100644 --- a/node_modules/negotiator/lib/encoding.js +++ b/node_modules/negotiator/lib/encoding.js @@ -1,32 +1,5 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - module.exports = preferredEncodings; -module.exports.preferredEncodings = preferredEncodings; - -/** - * Module variables. - * @private - */ - -var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; - -/** - * Parse the Accept-Encoding header. - * @private - */ +preferredEncodings.preferredEncodings = preferredEncodings; function parseAcceptEncoding(accept) { var accepts = accept.split(','); @@ -61,13 +34,9 @@ function parseAcceptEncoding(accept) { return accepts; } -/** - * Parse an encoding from the Accept-Encoding header. - * @private - */ +function parseEncoding(s, i) { + var match = s.match(/^\s*(\S+?)\s*(?:;(.*))?$/); -function parseEncoding(str, i) { - var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; @@ -90,11 +59,6 @@ function parseEncoding(str, i) { }; } -/** - * Get the priority of an encoding. - * @private - */ - function getEncodingPriority(encoding, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -109,11 +73,6 @@ function getEncodingPriority(encoding, accepted, index) { return priority; } -/** - * Get the specificity of the encoding. - * @private - */ - function specify(encoding, spec, index) { var s = 0; if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ @@ -130,20 +89,14 @@ function specify(encoding, spec, index) { } }; -/** - * Get the preferred encodings from an Accept-Encoding header. - * @public - */ - function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); if (!provided) { // sorted list of all encodings - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullEncoding); + return accepts.filter(isQuality).sort(compareSpecs).map(function getEncoding(spec) { + return spec.encoding; + }); } var priorities = provided.map(function getPriority(type, index) { @@ -156,29 +109,10 @@ function preferredEncodings(accept, provided) { }); } -/** - * Compare two specs. - * @private - */ - function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } -/** - * Get full encoding string. - * @private - */ - -function getFullEncoding(spec) { - return spec.encoding; -} - -/** - * Check if a spec has any quality. - * @private - */ - function isQuality(spec) { return spec.q > 0; } diff --git a/node_modules/negotiator/lib/language.js b/node_modules/negotiator/lib/language.js index 1bd2d0e..ed9e1ec 100644 --- a/node_modules/negotiator/lib/language.js +++ b/node_modules/negotiator/lib/language.js @@ -1,32 +1,5 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - module.exports = preferredLanguages; -module.exports.preferredLanguages = preferredLanguages; - -/** - * Module variables. - * @private - */ - -var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; - -/** - * Parse the Accept-Language header. - * @private - */ +preferredLanguages.preferredLanguages = preferredLanguages; function parseAcceptLanguage(accept) { var accepts = accept.split(','); @@ -45,13 +18,8 @@ function parseAcceptLanguage(accept) { return accepts; } -/** - * Parse a language from the Accept-Language header. - * @private - */ - -function parseLanguage(str, i) { - var match = simpleLanguageRegExp.exec(str); +function parseLanguage(s, i) { + var match = s.match(/^\s*(\S+?)(?:-(\S+?))?\s*(?:;(.*))?$/); if (!match) return null; var prefix = match[1], @@ -78,11 +46,6 @@ function parseLanguage(str, i) { }; } -/** - * Get the priority of a language. - * @private - */ - function getLanguagePriority(language, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -97,11 +60,6 @@ function getLanguagePriority(language, accepted, index) { return priority; } -/** - * Get the specificity of the language. - * @private - */ - function specify(language, spec, index) { var p = parseLanguage(language) if (!p) return null; @@ -124,21 +82,15 @@ function specify(language, spec, index) { } }; -/** - * Get the preferred languages from an Accept-Language header. - * @public - */ - function preferredLanguages(accept, provided) { // RFC 2616 sec 14.4: no header = * var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all languages - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullLanguage); + return accepts.filter(isQuality).sort(compareSpecs).map(function getLanguage(spec) { + return spec.full; + }); } var priorities = provided.map(function getPriority(type, index) { @@ -151,29 +103,10 @@ function preferredLanguages(accept, provided) { }); } -/** - * Compare two specs. - * @private - */ - function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } -/** - * Get full language string. - * @private - */ - -function getFullLanguage(spec) { - return spec.full; -} - -/** - * Check if a spec has any quality. - * @private - */ - function isQuality(spec) { return spec.q > 0; } diff --git a/node_modules/negotiator/lib/mediaType.js b/node_modules/negotiator/lib/mediaType.js index 67309dd..4170c25 100644 --- a/node_modules/negotiator/lib/mediaType.js +++ b/node_modules/negotiator/lib/mediaType.js @@ -6,27 +6,8 @@ * MIT Licensed */ -'use strict'; - -/** - * Module exports. - * @public - */ - module.exports = preferredMediaTypes; -module.exports.preferredMediaTypes = preferredMediaTypes; - -/** - * Module variables. - * @private - */ - -var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; - -/** - * Parse the Accept header. - * @private - */ +preferredMediaTypes.preferredMediaTypes = preferredMediaTypes; function parseAccept(accept) { var accepts = splitMediaTypes(accept); @@ -43,42 +24,35 @@ function parseAccept(accept) { accepts.length = j; return accepts; -} - -/** - * Parse a media type from the Accept header. - * @private - */ +}; -function parseMediaType(str, i) { - var match = simpleMediaTypeRegExp.exec(str); +function parseMediaType(s, i) { + var match = s.match(/\s*(\S+?)\/([^;\s]+)\s*(?:;(.*))?/); if (!match) return null; - var params = Object.create(null); - var q = 1; - var subtype = match[2]; - var type = match[1]; + var type = match[1], + subtype = match[2], + full = "" + type + "/" + subtype, + params = {}, + q = 1; if (match[3]) { - var kvps = splitParameters(match[3]).map(splitKeyValuePair); - - for (var j = 0; j < kvps.length; j++) { - var pair = kvps[j]; - var key = pair[0].toLowerCase(); - var val = pair[1]; - - // get the value, unwrapping quotes - var value = val && val[0] === '"' && val[val.length - 1] === '"' - ? val.substr(1, val.length - 2) - : val; - - if (key === 'q') { - q = parseFloat(value); - break; - } - - // store parameter - params[key] = value; + params = match[3].split(';').map(function(s) { + return s.trim().split('='); + }).reduce(function (set, p) { + var name = p[0].toLowerCase(); + var value = p[1]; + + set[name] = value && value[0] === '"' && value[value.length - 1] === '"' + ? value.substr(1, value.length - 2) + : value; + + return set; + }, params); + + if (params.q != null) { + q = parseFloat(params.q); + delete params.q; } } @@ -87,15 +61,11 @@ function parseMediaType(str, i) { subtype: subtype, params: params, q: q, - i: i + i: i, + full: full }; } -/** - * Get the priority of a media type. - * @private - */ - function getMediaTypePriority(type, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -110,11 +80,6 @@ function getMediaTypePriority(type, accepted, index) { return priority; } -/** - * Get the specificity of the media type. - * @private - */ - function specify(type, spec, index) { var p = parseMediaType(type); var s = 0; @@ -152,12 +117,8 @@ function specify(type, spec, index) { q: spec.q, s: s, } -} -/** - * Get the preferred media types from an Accept header. - * @public - */ +} function preferredMediaTypes(accept, provided) { // RFC 2616 sec 14.2: no header = */* @@ -165,10 +126,9 @@ function preferredMediaTypes(accept, provided) { if (!provided) { // sorted list of all types - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullType); + return accepts.filter(isQuality).sort(compareSpecs).map(function getType(spec) { + return spec.full; + }); } var priorities = provided.map(function getPriority(type, index) { @@ -181,38 +141,14 @@ function preferredMediaTypes(accept, provided) { }); } -/** - * Compare two specs. - * @private - */ - function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } -/** - * Get full type string. - * @private - */ - -function getFullType(spec) { - return spec.type + '/' + spec.subtype; -} - -/** - * Check if a spec has any quality. - * @private - */ - function isQuality(spec) { return spec.q > 0; } -/** - * Count the number of quotes in a string. - * @private - */ - function quoteCount(string) { var count = 0; var index = 0; @@ -225,31 +161,6 @@ function quoteCount(string) { return count; } -/** - * Split a key value pair. - * @private - */ - -function splitKeyValuePair(str) { - var index = str.indexOf('='); - var key; - var val; - - if (index === -1) { - key = str; - } else { - key = str.substr(0, index); - val = str.substr(index + 1); - } - - return [key, val]; -} - -/** - * Split an Accept header into media types. - * @private - */ - function splitMediaTypes(accept) { var accepts = accept.split(','); @@ -266,29 +177,3 @@ function splitMediaTypes(accept) { return accepts; } - -/** - * Split a string of parameters. - * @private - */ - -function splitParameters(str) { - var parameters = str.split(';'); - - for (var i = 1, j = 0; i < parameters.length; i++) { - if (quoteCount(parameters[j]) % 2 == 0) { - parameters[++j] = parameters[i]; - } else { - parameters[j] += ';' + parameters[i]; - } - } - - // trim parameters - parameters.length = j + 1; - - for (var i = 0; i < parameters.length; i++) { - parameters[i] = parameters[i].trim(); - } - - return parameters; -} diff --git a/node_modules/negotiator/package.json b/node_modules/negotiator/package.json index 594bfe6..5c73c11 100644 --- a/node_modules/negotiator/package.json +++ b/node_modules/negotiator/package.json @@ -2,50 +2,45 @@ "_args": [ [ { - "raw": "negotiator@0.6.1", + "raw": "negotiator@0.5.3", "scope": null, "escapedName": "negotiator", "name": "negotiator", - "rawSpec": "0.6.1", - "spec": "0.6.1", + "rawSpec": "0.5.3", + "spec": "0.5.3", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/accepts" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/accepts" ] ], - "_from": "negotiator@0.6.1", - "_id": "negotiator@0.6.1", + "_from": "negotiator@0.5.3", + "_id": "negotiator@0.5.3", "_inCache": true, "_installable": true, "_location": "/negotiator", - "_nodeVersion": "4.4.3", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/negotiator-0.6.1.tgz_1462250848695_0.027451182017102838" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.15.1", + "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "negotiator@0.6.1", + "raw": "negotiator@0.5.3", "scope": null, "escapedName": "negotiator", "name": "negotiator", - "rawSpec": "0.6.1", - "spec": "0.6.1", + "rawSpec": "0.5.3", + "spec": "0.5.3", "type": "version" }, "_requiredBy": [ "/accepts" ], - "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "_shasum": "2b327184e8992101177b28563fb5e7102acd0ca9", + "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz", + "_shasum": "269d5c476810ec92edbe7b6c2f28316384f9a7e8", "_shrinkwrap": null, - "_spec": "negotiator@0.6.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/accepts", + "_spec": "negotiator@0.5.3", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/accepts", "bugs": { "url": "https://github.com/jshttp/negotiator/issues" }, @@ -67,13 +62,13 @@ "dependencies": {}, "description": "HTTP content negotiation", "devDependencies": { - "istanbul": "0.4.3", + "istanbul": "0.3.9", "mocha": "~1.21.5" }, "directories": {}, "dist": { - "shasum": "2b327184e8992101177b28563fb5e7102acd0ca9", - "tarball": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz" + "shasum": "269d5c476810ec92edbe7b6c2f28316384f9a7e8", + "tarball": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz" }, "engines": { "node": ">= 0.6" @@ -85,8 +80,8 @@ "index.js", "README.md" ], - "gitHead": "751c381c32707f238143cd65d78520e16f4ef9e5", - "homepage": "https://github.com/jshttp/negotiator#readme", + "gitHead": "cbb717b3f164f25820f90b160cda6d0166b9d922", + "homepage": "https://github.com/jshttp/negotiator", "keywords": [ "http", "content negotiation", @@ -97,14 +92,14 @@ ], "license": "MIT", "maintainers": [ - { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, { "name": "federomero", "email": "federomero@gmail.com" }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" @@ -122,5 +117,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "version": "0.6.1" + "version": "0.5.3" } diff --git a/node_modules/on-finished/package.json b/node_modules/on-finished/package.json index 3eca865..87b1521 100644 --- a/node_modules/on-finished/package.json +++ b/node_modules/on-finished/package.json @@ -10,7 +10,7 @@ "spec": ">=2.3.0 <2.4.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser" ] ], "_from": "on-finished@>=2.3.0 <2.4.0", @@ -34,15 +34,18 @@ "type": "range" }, "_requiredBy": [ + "/body-parser", "/express", "/finalhandler", - "/send" + "/morgan", + "/send", + "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "_shasum": "20f1336481b083cd75337992a16971aa2d906947", "_shrinkwrap": null, "_spec": "on-finished@~2.3.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser", "bugs": { "url": "https://github.com/jshttp/on-finished/issues" }, diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json index 30ac368..8424fc4 100644 --- a/node_modules/parseurl/package.json +++ b/node_modules/parseurl/package.json @@ -10,7 +10,7 @@ "spec": ">=1.3.1 <1.4.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "parseurl@>=1.3.1 <1.4.0", @@ -35,13 +35,14 @@ }, "_requiredBy": [ "/express", + "/serve-favicon", "/serve-static" ], "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "_shasum": "c8ab8c9223ba34888aa64a297b28853bec18da56", "_shrinkwrap": null, "_spec": "parseurl@~1.3.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json index 9a4fce9..e8c8f0d 100644 --- a/node_modules/path-to-regexp/package.json +++ b/node_modules/path-to-regexp/package.json @@ -10,7 +10,7 @@ "spec": "0.1.7", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "path-to-regexp@0.1.7", @@ -41,7 +41,7 @@ "_shasum": "df604178005f522f15eb4490e7247a1bfaa67f8c", "_shrinkwrap": null, "_spec": "path-to-regexp@0.1.7", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "bugs": { "url": "https://github.com/component/path-to-regexp/issues" }, diff --git a/node_modules/proxy-addr/HISTORY.md b/node_modules/proxy-addr/HISTORY.md index a7389db..84f11aa 100644 --- a/node_modules/proxy-addr/HISTORY.md +++ b/node_modules/proxy-addr/HISTORY.md @@ -1,22 +1,3 @@ -1.1.2 / 2016-05-29 -================== - - * deps: ipaddr.js@1.1.1 - - Fix IPv6-mapped IPv4 validation edge cases - -1.1.1 / 2016-05-03 -================== - - * Fix regression matching mixed versions against multiple subnets - -1.1.0 / 2016-05-01 -================== - - * Fix accepting various invalid netmasks - - IPv4 netmasks must be contingous - - IPv6 addresses cannot be used as a netmask - * deps: ipaddr.js@1.1.0 - 1.0.10 / 2015-12-09 =================== diff --git a/node_modules/proxy-addr/LICENSE b/node_modules/proxy-addr/LICENSE index cab251c..b7dce6c 100644 --- a/node_modules/proxy-addr/LICENSE +++ b/node_modules/proxy-addr/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2016 Douglas Christopher Wilson +Copyright (c) 2014 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/proxy-addr/README.md b/node_modules/proxy-addr/README.md index 1bffc76..26f7fc0 100644 --- a/node_modules/proxy-addr/README.md +++ b/node_modules/proxy-addr/README.md @@ -49,6 +49,7 @@ automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`). ```js proxyaddr(req, '::1') proxyaddr(req, ['::1/128', 'fe80::/10']) +proxyaddr(req, ['fe80::/ffc0::']) ``` This module will automatically work with IPv4-mapped IPv6 addresses diff --git a/node_modules/proxy-addr/index.js b/node_modules/proxy-addr/index.js index 0b3cf0b..3200efb 100644 --- a/node_modules/proxy-addr/index.js +++ b/node_modules/proxy-addr/index.js @@ -1,6 +1,6 @@ /*! * proxy-addr - * Copyright(c) 2014-2016 Douglas Christopher Wilson + * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ @@ -148,38 +148,45 @@ function compileTrust(rangeSubnets) { */ function parseipNotation(note) { + var ip; + var kind; + var max; var pos = note.lastIndexOf('/'); - var str = pos !== -1 + var range; + + ip = pos !== -1 ? note.substring(0, pos) : note; - if (!isip(str)) { - throw new TypeError('invalid IP address: ' + str); + if (!isip(ip)) { + throw new TypeError('invalid IP address: ' + ip); } - var ip = parseip(str); + ip = parseip(ip); - if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { - // Store as IPv4 - ip = ip.toIPv4Address(); - } - - var max = ip.kind() === 'ipv6' + kind = ip.kind(); + max = kind === 'ipv6' ? 128 : 32; - var range = pos !== -1 + range = pos !== -1 ? note.substring(pos + 1, note.length) - : null; - - if (range === null) { - range = max; - } else if (digitre.test(range)) { - range = parseInt(range, 10); - } else if (ip.kind() === 'ipv4' && isip(range)) { - range = parseNetmask(range); - } else { - range = null; + : max; + + if (typeof range !== 'number') { + range = digitre.test(range) + ? parseInt(range, 10) + : isip(range) + ? parseNetmask(range) + : 0; + } + + if (ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { + // Store as IPv4 + ip = ip.toIPv4Address(); + range = range <= max + ? range - 96 + : range; } if (range <= 0 || range > max) { @@ -192,17 +199,47 @@ function parseipNotation(note) { /** * Parse netmask string into CIDR range. * - * @param {String} netmask + * @param {String} note * @api private */ function parseNetmask(netmask) { var ip = parseip(netmask); - var kind = ip.kind(); + var parts; + var size; + + switch (ip.kind()) { + case 'ipv4': + parts = ip.octets; + size = 8; + break; + case 'ipv6': + parts = ip.parts; + size = 16; + break; + } - return kind === 'ipv4' - ? ip.prefixLengthFromSubnetMask() - : null; + var max = Math.pow(2, size) - 1; + var part; + var range = 0; + + for (var i = 0; i < parts.length; i++) { + part = parts[i] & max; + + if (part === max) { + range += size; + continue; + } + + while (part) { + part = (part << 1) & max; + range += 1; + } + + break; + } + + return range; } /** @@ -250,35 +287,32 @@ function trustMulti(subnets) { if (!isip(addr)) return false; var ip = parseip(addr); - var ipconv; + var ipv4; var kind = ip.kind(); + var subnet; + var subnetip; + var subnetkind; + var subnetrange; + var trusted; for (var i = 0; i < subnets.length; i++) { - var subnet = subnets[i]; - var subnetip = subnet[0]; - var subnetkind = subnetip.kind(); - var subnetrange = subnet[1]; - var trusted = ip; + subnet = subnets[i]; + subnetip = subnet[0]; + subnetkind = subnetip.kind(); + subnetrange = subnet[1]; + trusted = ip; if (kind !== subnetkind) { - if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { - // Incompatible IP addresses + if (kind !== 'ipv6' || subnetkind !== 'ipv4' || !ip.isIPv4MappedAddress()) { continue; } - if (!ipconv) { - // Convert IP to match subnet IP kind - ipconv = subnetkind === 'ipv4' - ? ip.toIPv4Address() - : ip.toIPv4MappedAddress(); - } - - trusted = ipconv; + // Store addr as IPv4 + ipv4 = ipv4 || ip.toIPv4Address(); + trusted = ipv4; } - if (trusted.match(subnetip, subnetrange)) { - return true; - } + if (trusted.match(subnetip, subnetrange)) return true; } return false; @@ -304,18 +338,10 @@ function trustSingle(subnet) { var ip = parseip(addr); var kind = ip.kind(); - if (kind !== subnetkind) { - if (subnetisipv4 && !ip.isIPv4MappedAddress()) { - // Incompatible IP addresses - return false; - } - - // Convert IP to match subnet IP kind - ip = subnetisipv4 - ? ip.toIPv4Address() - : ip.toIPv4MappedAddress(); - } - - return ip.match(subnetip, subnetrange); + return kind === subnetkind + ? ip.match(subnetip, subnetrange) + : subnetisipv4 && kind === 'ipv6' && ip.isIPv4MappedAddress() + ? ip.toIPv4Address().match(subnetip, subnetrange) + : false; }; } diff --git a/node_modules/proxy-addr/package.json b/node_modules/proxy-addr/package.json index 831cb4e..9943652 100644 --- a/node_modules/proxy-addr/package.json +++ b/node_modules/proxy-addr/package.json @@ -2,50 +2,45 @@ "_args": [ [ { - "raw": "proxy-addr@~1.1.2", + "raw": "proxy-addr@~1.0.10", "scope": null, "escapedName": "proxy-addr", "name": "proxy-addr", - "rawSpec": "~1.1.2", - "spec": ">=1.1.2 <1.2.0", + "rawSpec": "~1.0.10", + "spec": ">=1.0.10 <1.1.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "proxy-addr@>=1.1.2 <1.2.0", - "_id": "proxy-addr@1.1.2", + "_from": "proxy-addr@>=1.0.10 <1.1.0", + "_id": "proxy-addr@1.0.10", "_inCache": true, "_installable": true, "_location": "/proxy-addr", - "_nodeVersion": "4.4.3", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/proxy-addr-1.1.2.tgz_1464573376704_0.6896329398732632" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.15.1", + "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "proxy-addr@~1.1.2", + "raw": "proxy-addr@~1.0.10", "scope": null, "escapedName": "proxy-addr", "name": "proxy-addr", - "rawSpec": "~1.1.2", - "spec": ">=1.1.2 <1.2.0", + "rawSpec": "~1.0.10", + "spec": ">=1.0.10 <1.1.0", "type": "range" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.2.tgz", - "_shasum": "b4cc5f22610d9535824c123aef9d3cf73c40ba37", + "_resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.10.tgz", + "_shasum": "0d40a82f801fc355567d2ecb65efe3f077f121c5", "_shrinkwrap": null, - "_spec": "proxy-addr@~1.1.2", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "proxy-addr@~1.0.10", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" @@ -55,19 +50,19 @@ }, "dependencies": { "forwarded": "~0.1.0", - "ipaddr.js": "1.1.1" + "ipaddr.js": "1.0.5" }, "description": "Determine address of proxied request", "devDependencies": { "beautify-benchmark": "0.2.4", - "benchmark": "2.1.0", - "istanbul": "0.4.3", + "benchmark": "1.0.0", + "istanbul": "0.4.1", "mocha": "~1.21.5" }, "directories": {}, "dist": { - "shasum": "b4cc5f22610d9535824c123aef9d3cf73c40ba37", - "tarball": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.2.tgz" + "shasum": "0d40a82f801fc355567d2ecb65efe3f077f121c5", + "tarball": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.10.tgz" }, "engines": { "node": ">= 0.6" @@ -78,8 +73,8 @@ "README.md", "index.js" ], - "gitHead": "28c34525632884a6d5e69a9165d7420b3f972d8b", - "homepage": "https://github.com/jshttp/proxy-addr#readme", + "gitHead": "0cdb6444100a7930285ed2555d0c3c687690a7a5", + "homepage": "https://github.com/jshttp/proxy-addr", "keywords": [ "ip", "proxy", @@ -90,6 +85,26 @@ { "name": "dougwilson", "email": "doug@somethingdoug.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "mscdex", + "email": "mscdex@mscdex.net" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" } ], "name": "proxy-addr", @@ -105,5 +120,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "version": "1.1.2" + "version": "1.0.10" } diff --git a/node_modules/qs/package.json b/node_modules/qs/package.json index 85c5ba7..ff75679 100644 --- a/node_modules/qs/package.json +++ b/node_modules/qs/package.json @@ -10,7 +10,7 @@ "spec": "6.2.0", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser" ] ], "_from": "qs@6.2.0", @@ -39,13 +39,13 @@ "type": "version" }, "_requiredBy": [ - "/express" + "/body-parser" ], "_resolved": "https://registry.npmjs.org/qs/-/qs-6.2.0.tgz", "_shasum": "3b7848c03c2dece69a9522b0fae8c4126d745f3b", "_shrinkwrap": null, "_spec": "qs@6.2.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser", "bugs": { "url": "https://github.com/ljharb/qs/issues" }, diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md index 5e01eef..f640bea 100644 --- a/node_modules/range-parser/HISTORY.md +++ b/node_modules/range-parser/HISTORY.md @@ -1,16 +1,5 @@ -1.2.0 / 2016-06-01 -================== - - * Add `combine` option to combine overlapping ranges - -1.1.0 / 2016-05-13 -================== - - * Fix incorrectly returning -1 when there is at least one valid range - * perf: remove internal function - -1.0.3 / 2015-10-29 -================== +unreleased +========== * perf: enable strict mode diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE index 3599954..a491841 100644 --- a/node_modules/range-parser/LICENSE +++ b/node_modules/range-parser/LICENSE @@ -1,7 +1,6 @@ (The MIT License) -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015-2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/range-parser/README.md b/node_modules/range-parser/README.md index 1b24375..32f58f6 100644 --- a/node_modules/range-parser/README.md +++ b/node_modules/range-parser/README.md @@ -20,17 +20,17 @@ $ npm install range-parser var parseRange = require('range-parser') ``` -### parseRange(size, header, options) +### parseRange(size, header) Parse the given `header` string where `size` is the maximum size of the resource. An array of ranges will be returned or negative numbers indicating an error parsing. * `-2` signals a malformed header string - * `-1` signals an unsatisfiable range + * `-1` signals an invalid range ```js // parse header from request -var range = parseRange(size, req.headers.range) +var range = parseRange(req.headers.range) // the type of the range if (range.type === 'bytes') { @@ -41,24 +41,6 @@ if (range.type === 'bytes') { } ``` -#### Options - -These properties are accepted in the options object. - -##### combine - -Specifies if overlapping & adjacent ranges should be combined, defaults to `false`. -When `true`, ranges will be combined and returned as if they were specified that -way in the header. - -```js -parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) -// => [ -// { start: 0, end: 10 }, -// { start: 50, end: 60 } -// ] -``` - ## License [MIT](LICENSE) @@ -66,7 +48,7 @@ parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) [npm-image]: https://img.shields.io/npm/v/range-parser.svg [npm-url]: https://npmjs.org/package/range-parser [node-version-image]: https://img.shields.io/node/v/range-parser.svg -[node-version-url]: https://nodejs.org/endownload +[node-version-url]: http://nodejs.org/download/ [travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg [travis-url]: https://travis-ci.org/jshttp/range-parser [coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js index 83b2eb6..814e533 100644 --- a/node_modules/range-parser/index.js +++ b/node_modules/range-parser/index.js @@ -1,158 +1,63 @@ /*! * range-parser * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed */ -'use strict' +'use strict'; /** * Module exports. * @public */ -module.exports = rangeParser +module.exports = rangeParser; /** * Parse "Range" header `str` relative to the given file `size`. * * @param {Number} size * @param {String} str - * @param {Object} [options] * @return {Array} * @public */ -function rangeParser (size, str, options) { - var index = str.indexOf('=') +function rangeParser(size, str) { + var valid = true; + var i = str.indexOf('='); - if (index === -1) { - return -2 - } + if (-1 == i) return -2; - // split the range string - var arr = str.slice(index + 1).split(',') - var ranges = [] - - // add ranges type - ranges.type = str.slice(0, index) - - // parse all ranges - for (var i = 0; i < arr.length; i++) { - var range = arr[i].split('-') - var start = parseInt(range[0], 10) - var end = parseInt(range[1], 10) + var arr = str.slice(i + 1).split(',').map(function(range){ + var range = range.split('-') + , start = parseInt(range[0], 10) + , end = parseInt(range[1], 10); // -nnn if (isNaN(start)) { - start = size - end - end = size - 1 + start = size - end; + end = size - 1; // nnn- } else if (isNaN(end)) { - end = size - 1 + end = size - 1; } // limit last-byte-pos to current length - if (end > size - 1) { - end = size - 1 - } + if (end > size - 1) end = size - 1; - // invalid or unsatisifiable - if (isNaN(start) || isNaN(end) || start > end || start < 0) { - continue - } + // invalid + if (isNaN(start) + || isNaN(end) + || start > end + || start < 0) valid = false; - // add range - ranges.push({ + return { start: start, end: end - }) - } - - if (ranges.length < 1) { - // unsatisifiable - return -1 - } - - return options && options.combine - ? combineRanges(ranges) - : ranges -} - -/** - * Combine overlapping & adjacent ranges. - * @private - */ - -function combineRanges (ranges) { - var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) - - for (var j = 0, i = 1; i < ordered.length; i++) { - var range = ordered[i] - var current = ordered[j] - - if (range.start > current.end + 1) { - // next range - ordered[++j] = range - } else if (range.end > current.end) { - // extend range - current.end = range.end - current.index = Math.min(current.index, range.index) - } - } - - // trim ordered array - ordered.length = j + 1 - - // generate combined range - var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) - - // copy ranges type - combined.type = ranges.type - - return combined -} - -/** - * Map function to add index value to ranges. - * @private - */ - -function mapWithIndex (range, index) { - return { - start: range.start, - end: range.end, - index: index - } -} - -/** - * Map function to remove index value from ranges. - * @private - */ + }; + }); -function mapWithoutIndex (range) { - return { - start: range.start, - end: range.end - } -} - -/** - * Sort function to sort ranges by index. - * @private - */ - -function sortByRangeIndex (a, b) { - return a.index - b.index -} - -/** - * Sort function to sort ranges by start position. - * @private - */ + arr.type = str.slice(0, i); -function sortByRangeStart (a, b) { - return a.start - b.start + return valid ? arr : -1; } diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json index 3082af8..815ec90 100644 --- a/node_modules/range-parser/package.json +++ b/node_modules/range-parser/package.json @@ -2,26 +2,22 @@ "_args": [ [ { - "raw": "range-parser@~1.2.0", + "raw": "range-parser@~1.0.3", "scope": null, "escapedName": "range-parser", "name": "range-parser", - "rawSpec": "~1.2.0", - "spec": ">=1.2.0 <1.3.0", + "rawSpec": "~1.0.3", + "spec": ">=1.0.3 <1.1.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "range-parser@>=1.2.0 <1.3.0", - "_id": "range-parser@1.2.0", + "_from": "range-parser@>=1.0.3 <1.1.0", + "_id": "range-parser@1.0.3", "_inCache": true, "_installable": true, "_location": "/range-parser", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/range-parser-1.2.0.tgz_1464803293097_0.6830497414339334" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -29,23 +25,24 @@ "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "range-parser@~1.2.0", + "raw": "range-parser@~1.0.3", "scope": null, "escapedName": "range-parser", "name": "range-parser", - "rawSpec": "~1.2.0", - "spec": ">=1.2.0 <1.3.0", + "rawSpec": "~1.0.3", + "spec": ">=1.0.3 <1.1.0", "type": "range" }, "_requiredBy": [ "/express", - "/send" + "/send", + "/serve-static/send" ], - "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "_shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e", + "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz", + "_shasum": "6872823535c692e2c2a0103826afd82c2e0ff175", "_shrinkwrap": null, - "_spec": "range-parser@~1.2.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "range-parser@~1.0.3", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca", @@ -54,35 +51,16 @@ "bugs": { "url": "https://github.com/jshttp/range-parser/issues" }, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "James Wyatt Cready", - "email": "wyatt.cready@lanetix.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], "dependencies": {}, "description": "Range header field string parser", "devDependencies": { - "eslint": "2.11.1", - "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.1.0", - "eslint-plugin-standard": "1.3.2", - "istanbul": "0.4.3", + "istanbul": "0.4.0", "mocha": "1.21.5" }, "directories": {}, "dist": { - "shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e", - "tarball": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz" + "shasum": "6872823535c692e2c2a0103826afd82c2e0ff175", + "tarball": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz" }, "engines": { "node": ">= 0.6" @@ -92,7 +70,7 @@ "LICENSE", "index.js" ], - "gitHead": "0665aca31639d799dee1d35fb10970799559ec48", + "gitHead": "18e46a3de74afff9f4e22717f11ddd6e9aa6d845", "homepage": "https://github.com/jshttp/range-parser", "keywords": [ "range", @@ -102,20 +80,20 @@ "license": "MIT", "maintainers": [ { - "name": "dougwilson", - "email": "doug@somethingdoug.com" + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" }, { "name": "jonathanong", "email": "jonathanrichardong@gmail.com" }, { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" } ], "name": "range-parser", @@ -126,10 +104,9 @@ "url": "git+https://github.com/jshttp/range-parser.git" }, "scripts": { - "lint": "eslint **/*.js", "test": "mocha --reporter spec", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" }, - "version": "1.2.0" + "version": "1.0.3" } diff --git a/node_modules/send/HISTORY.md b/node_modules/send/HISTORY.md index f30e345..d3dca9c 100644 --- a/node_modules/send/HISTORY.md +++ b/node_modules/send/HISTORY.md @@ -1,39 +1,3 @@ -0.14.1 / 2016-06-09 -=================== - - * Fix redirect error when `path` contains raw non-URL characters - * Fix redirect when `path` starts with multiple forward slashes - -0.14.0 / 2016-06-06 -=================== - - * Add `acceptRanges` option - * Add `cacheControl` option - * Attempt to combine multiple ranges into single range - * Correctly inherit from `Stream` class - * Fix `Content-Range` header in 416 responses when using `start`/`end` options - * Fix `Content-Range` header missing from default 416 responses - * Ignore non-byte `Range` headers - * deps: http-errors@~1.5.0 - - Add `HttpError` export, for `err instanceof createError.HttpError` - - Support new code `421 Misdirected Request` - - Use `setprototypeof` module to replace `__proto__` setting - - deps: inherits@2.0.1 - - deps: statuses@'>= 1.3.0 < 2' - - perf: enable strict mode - * deps: range-parser@~1.2.0 - - Fix incorrectly returning -1 when there is at least one valid range - - perf: remove internal function - * deps: statuses@~1.3.0 - - Add `421 Misdirected Request` - - perf: enable strict mode - * perf: remove argument reassignment - -0.13.2 / 2016-03-05 -=================== - - * Fix invalid `Content-Type` header when `send.mime.default_type` unset - 0.13.1 / 2016-01-16 =================== diff --git a/node_modules/send/LICENSE b/node_modules/send/LICENSE index 4aa69e8..e4d595b 100644 --- a/node_modules/send/LICENSE +++ b/node_modules/send/LICENSE @@ -1,7 +1,7 @@ (The MIT License) Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2014-2016 Douglas Christopher Wilson +Copyright (c) 2014-2015 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/send/README.md b/node_modules/send/README.md index 4167926..3586060 100644 --- a/node_modules/send/README.md +++ b/node_modules/send/README.md @@ -34,17 +34,6 @@ not the actual file-system path). #### Options -##### acceptRanges - -Enable or disable accepting ranged requests, defaults to true. -Disabling this will not send `Accept-Ranges` and ignore the contents -of the `Range` request header. - -##### cacheControl - -Enable or disable setting `Cache-Control` response header, defaults to -true. Disabling this will ignore the `maxAge` option. - ##### dotfiles Set how "dotfiles" are treated when encountered. A dotfile is a file @@ -62,12 +51,6 @@ The default value is _similar_ to `'ignore'`, with the exception that this default will not ignore the files within a directory that begins with a dot, for backward-compatibility. -##### end - -Byte offset at which the stream ends, defaults to the length of the file -minus 1. The end is inclusive in the stream, meaning `end: 3` will include -the 4th byte in the stream. - ##### etag Enable or disable etag generation, defaults to true. @@ -100,12 +83,7 @@ This can also be a string accepted by the Serve files relative to `path`. -##### start - -Byte offset at which the stream starts, defaults to 0. The start is inclusive, -meaning `start: 2` will include the 3rd byte in the stream. - -#### Events +### Events The `SendStream` is an event emitter and will emit the following events: @@ -116,20 +94,11 @@ The `SendStream` is an event emitter and will emit the following events: - `stream` file streaming has started `(stream)` - `end` streaming has completed -#### .pipe +### .pipe The `pipe` method is used to pipe the response into the Node.js HTTP response object, typically `send(req, path, options).pipe(res)`. -### .mime - -The `mime` export is the global instance of of the -[`mime` npm module](https://www.npmjs.com/package/mime). - -This is used to configure the MIME types that are associated with file extensions -as well as other options for how to resolve the MIME type of a file (like the -default type to use for an unknown file extension). - ## Error-handling By default when no `error` listeners are present an automatic response will be @@ -163,70 +132,49 @@ $ npm test ### Small example ```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -var app = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname).pipe(res) -}).listen(3000) -``` - -### Custom file types - -```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -// Default unknown types to text/plain -send.mime.default_type = 'text/plain' +var http = require('http'); +var send = require('send'); -// Add a custom type -send.mime.define({ - 'application/x-my-type': ['x-mt', 'x-mtt'] -}) - -var app = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname).pipe(res) -}).listen(3000) +var app = http.createServer(function(req, res){ + send(req, req.url).pipe(res); +}).listen(3000); ``` -### Serving from a root directory with custom error-handling +Serving from a root directory with custom error-handling: ```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') +var http = require('http'); +var send = require('send'); +var url = require('url'); -var app = http.createServer(function onRequest (req, res) { +var app = http.createServer(function(req, res){ // your custom error-handling logic: - function error (err) { - res.statusCode = err.status || 500 - res.end(err.message) + function error(err) { + res.statusCode = err.status || 500; + res.end(err.message); } // your custom headers - function headers (res, path, stat) { + function headers(res, path, stat) { // serve all files for download - res.setHeader('Content-Disposition', 'attachment') + res.setHeader('Content-Disposition', 'attachment'); } // your custom directory handling logic: - function redirect () { - res.statusCode = 301 - res.setHeader('Location', req.url + '/') - res.end('Redirecting to ' + req.url + '/') + function redirect() { + res.statusCode = 301; + res.setHeader('Location', req.url + '/'); + res.end('Redirecting to ' + req.url + '/'); } // transfer arbitrary files from within // /www/example.com/public/* - send(req, parseUrl(req).pathname, {root: '/www/example.com/public'}) + send(req, url.parse(req.url).pathname, {root: '/www/example.com/public'}) .on('error', error) .on('directory', redirect) .on('headers', headers) .pipe(res); -}).listen(3000) +}).listen(3000); ``` ## License diff --git a/node_modules/send/index.js b/node_modules/send/index.js index 81ec0b3..3510989 100644 --- a/node_modules/send/index.js +++ b/node_modules/send/index.js @@ -1,7 +1,7 @@ /*! * send * Copyright(c) 2012 TJ Holowaychuk - * Copyright(c) 2014-2016 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -16,52 +16,30 @@ var createError = require('http-errors') var debug = require('debug')('send') var deprecate = require('depd')('send') var destroy = require('destroy') -var encodeUrl = require('encodeurl') var escapeHtml = require('escape-html') + , parseRange = require('range-parser') + , Stream = require('stream') + , mime = require('mime') + , fresh = require('fresh') + , path = require('path') + , fs = require('fs') + , normalize = path.normalize + , join = path.join var etag = require('etag') -var EventEmitter = require('events').EventEmitter -var fresh = require('fresh') -var fs = require('fs') -var mime = require('mime') -var ms = require('ms') +var EventEmitter = require('events').EventEmitter; +var ms = require('ms'); var onFinished = require('on-finished') -var parseRange = require('range-parser') -var path = require('path') var statuses = require('statuses') -var Stream = require('stream') -var util = require('util') /** - * Path function references. - * @private + * Variables. */ - var extname = path.extname -var join = path.join -var normalize = path.normalize +var maxMaxAge = 60 * 60 * 24 * 365 * 1000; // 1 year var resolve = path.resolve var sep = path.sep - -/** - * Regular expression for identifying a bytes Range header. - * @private - */ - -var BYTES_RANGE_REGEXP = /^ *bytes=/ - -/** - * Maximum value allowed for the max age. - * @private - */ - -var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year - -/** - * Regular expression to match a path with a directory up component. - * @private - */ - -var UP_PATH_REGEXP = /(?:^|[\\\/])\.\.(?:[\\\/]|$)/ +var toString = Object.prototype.toString +var upPathRegexp = /(?:^|[\\\/])\.\.(?:[\\\/]|$)/ /** * Module exports. @@ -76,8 +54,8 @@ module.exports.mime = mime */ /* istanbul ignore next */ -var listenerCount = EventEmitter.listenerCount || - function (emitter, type) { return emitter.listeners(type).length } +var listenerCount = EventEmitter.listenerCount + || function(emitter, type){ return emitter.listeners(type).length; }; /** * Return a `SendStream` for `req` and `path`. @@ -89,8 +67,8 @@ var listenerCount = EventEmitter.listenerCount || * @public */ -function send (req, path, options) { - return new SendStream(req, path, options) +function send(req, path, options) { + return new SendStream(req, path, options); } /** @@ -102,23 +80,13 @@ function send (req, path, options) { * @private */ -function SendStream (req, path, options) { - Stream.call(this) - +function SendStream(req, path, options) { var opts = options || {} this.options = opts this.path = path this.req = req - this._acceptRanges = opts.acceptRanges !== undefined - ? Boolean(opts.acceptRanges) - : true - - this._cacheControl = opts.cacheControl !== undefined - ? Boolean(opts.cacheControl) - : true - this._etag = opts.etag !== undefined ? Boolean(opts.etag) : true @@ -159,7 +127,7 @@ function SendStream (req, path, options) { ? ms(this._maxage) : Number(this._maxage) this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + ? Math.min(Math.max(0, this._maxage), maxMaxAge) : 0 this._root = opts.root @@ -172,10 +140,10 @@ function SendStream (req, path, options) { } /** - * Inherits from `Stream`. + * Inherits from `Stream.prototype`. */ -util.inherits(SendStream, Stream) +SendStream.prototype.__proto__ = Stream.prototype; /** * Enable or disable etag generation. @@ -185,11 +153,12 @@ util.inherits(SendStream, Stream) * @api public */ -SendStream.prototype.etag = deprecate.function(function etag (val) { - this._etag = Boolean(val) - debug('etag %s', this._etag) - return this -}, 'send.etag: pass etag as option') +SendStream.prototype.etag = deprecate.function(function etag(val) { + val = Boolean(val); + debug('etag %s', val); + this._etag = val; + return this; +}, 'send.etag: pass etag as option'); /** * Enable or disable "hidden" (dot) files. @@ -199,12 +168,13 @@ SendStream.prototype.etag = deprecate.function(function etag (val) { * @api public */ -SendStream.prototype.hidden = deprecate.function(function hidden (val) { - this._hidden = Boolean(val) +SendStream.prototype.hidden = deprecate.function(function hidden(val) { + val = Boolean(val); + debug('hidden %s', val); + this._hidden = val; this._dotfiles = undefined - debug('hidden %s', this._hidden) - return this -}, 'send.hidden: use dotfiles option') + return this; +}, 'send.hidden: use dotfiles option'); /** * Set index `paths`, set to a falsy @@ -215,12 +185,12 @@ SendStream.prototype.hidden = deprecate.function(function hidden (val) { * @api public */ -SendStream.prototype.index = deprecate.function(function index (paths) { - var index = !paths ? [] : normalizeList(paths, 'paths argument') - debug('index %o', paths) - this._index = index - return this -}, 'send.index: pass index as option') +SendStream.prototype.index = deprecate.function(function index(paths) { + var index = !paths ? [] : normalizeList(paths, 'paths argument'); + debug('index %o', paths); + this._index = index; + return this; +}, 'send.index: pass index as option'); /** * Set root `path`. @@ -230,17 +200,17 @@ SendStream.prototype.index = deprecate.function(function index (paths) { * @api public */ -SendStream.prototype.root = function root (path) { - this._root = resolve(String(path)) - debug('root %s', this._root) - return this -} +SendStream.prototype.root = function(path){ + path = String(path); + this._root = resolve(path) + return this; +}; SendStream.prototype.from = deprecate.function(SendStream.prototype.root, - 'send.from: pass root as option') + 'send.from: pass root as option'); SendStream.prototype.root = deprecate.function(SendStream.prototype.root, - 'send.root: pass root as option') + 'send.root: pass root as option'); /** * Set max-age to `maxAge`. @@ -250,16 +220,16 @@ SendStream.prototype.root = deprecate.function(SendStream.prototype.root, * @api public */ -SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) { - this._maxage = typeof maxAge === 'string' +SendStream.prototype.maxage = deprecate.function(function maxage(maxAge) { + maxAge = typeof maxAge === 'string' ? ms(maxAge) - : Number(maxAge) - this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) - : 0 - debug('max-age %d', this._maxage) - return this -}, 'send.maxage: pass maxAge as option') + : Number(maxAge); + if (isNaN(maxAge)) maxAge = 0; + if (Infinity == maxAge) maxAge = 60 * 60 * 24 * 365 * 1000; + debug('max-age %d', maxAge); + this._maxage = maxAge; + return this; +}, 'send.maxage: pass maxAge as option'); /** * Emit error with `status`. @@ -269,7 +239,7 @@ SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) { * @private */ -SendStream.prototype.error = function error (status, error) { +SendStream.prototype.error = function error(status, error) { // emit if listeners instead of responding if (listenerCount(this, 'error') !== 0) { return this.emit('error', createError(error, status, { @@ -280,13 +250,8 @@ SendStream.prototype.error = function error (status, error) { var res = this.res var msg = statuses[status] - // clear existing headers - clearHeaders(res) - - // add error headers - if (error && error.headers) { - setHeaders(res, error.headers) - } + // wipe all existing headers + res._headers = null // send basic response res.statusCode = status @@ -303,9 +268,9 @@ SendStream.prototype.error = function error (status, error) { * @api private */ -SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { - return this.path[this.path.length - 1] === '/' -} +SendStream.prototype.hasTrailingSlash = function(){ + return '/' == this.path[this.path.length - 1]; +}; /** * Check if this is a conditional GET request. @@ -314,10 +279,10 @@ SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { * @api private */ -SendStream.prototype.isConditionalGET = function isConditionalGET () { - return this.req.headers['if-none-match'] || - this.req.headers['if-modified-since'] -} +SendStream.prototype.isConditionalGET = function(){ + return this.req.headers['if-none-match'] + || this.req.headers['if-modified-since']; +}; /** * Strip content-* header fields. @@ -325,7 +290,7 @@ SendStream.prototype.isConditionalGET = function isConditionalGET () { * @private */ -SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { +SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields() { var res = this.res var headers = Object.keys(res._headers || {}) @@ -343,13 +308,13 @@ SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFie * @api private */ -SendStream.prototype.notModified = function notModified () { - var res = this.res - debug('not modified') - this.removeContentHeaderFields() - res.statusCode = 304 - res.end() -} +SendStream.prototype.notModified = function(){ + var res = this.res; + debug('not modified'); + this.removeContentHeaderFields(); + res.statusCode = 304; + res.end(); +}; /** * Raise error that headers already sent. @@ -357,11 +322,11 @@ SendStream.prototype.notModified = function notModified () { * @api private */ -SendStream.prototype.headersAlreadySent = function headersAlreadySent () { - var err = new Error('Can\'t set headers after they are sent.') - debug('headers already sent') - this.error(500, err) -} +SendStream.prototype.headersAlreadySent = function headersAlreadySent(){ + var err = new Error('Can\'t set headers after they are sent.'); + debug('headers already sent'); + this.error(500, err); +}; /** * Check if the request is cacheable, aka @@ -371,11 +336,10 @@ SendStream.prototype.headersAlreadySent = function headersAlreadySent () { * @api private */ -SendStream.prototype.isCachable = function isCachable () { - var statusCode = this.res.statusCode - return (statusCode >= 200 && statusCode < 300) || - statusCode === 304 -} +SendStream.prototype.isCachable = function(){ + var res = this.res; + return (res.statusCode >= 200 && res.statusCode < 300) || 304 == res.statusCode; +}; /** * Handle stat() error. @@ -384,7 +348,7 @@ SendStream.prototype.isCachable = function isCachable () { * @private */ -SendStream.prototype.onStatError = function onStatError (error) { +SendStream.prototype.onStatError = function onStatError(error) { switch (error.code) { case 'ENAMETOOLONG': case 'ENOENT': @@ -404,9 +368,9 @@ SendStream.prototype.onStatError = function onStatError (error) { * @api private */ -SendStream.prototype.isFresh = function isFresh () { - return fresh(this.req.headers, this.res._headers) -} +SendStream.prototype.isFresh = function(){ + return fresh(this.req.headers, this.res._headers); +}; /** * Check if the range is fresh. @@ -415,17 +379,15 @@ SendStream.prototype.isFresh = function isFresh () { * @api private */ -SendStream.prototype.isRangeFresh = function isRangeFresh () { - var ifRange = this.req.headers['if-range'] +SendStream.prototype.isRangeFresh = function isRangeFresh(){ + var ifRange = this.req.headers['if-range']; - if (!ifRange) { - return true - } + if (!ifRange) return true; return ~ifRange.indexOf('"') ? ~ifRange.indexOf(this.res._headers['etag']) - : Date.parse(this.res._headers['last-modified']) <= Date.parse(ifRange) -} + : Date.parse(this.res._headers['last-modified']) <= Date.parse(ifRange); +}; /** * Redirect to path. @@ -434,7 +396,7 @@ SendStream.prototype.isRangeFresh = function isRangeFresh () { * @private */ -SendStream.prototype.redirect = function redirect (path) { +SendStream.prototype.redirect = function redirect(path) { if (listenerCount(this, 'directory') !== 0) { this.emit('directory') return @@ -445,7 +407,7 @@ SendStream.prototype.redirect = function redirect (path) { return } - var loc = encodeUrl(collapseLeadingSlashes(path + '/')) + var loc = path + '/' var msg = 'Redirecting to ' + escapeHtml(loc) + '\n' var res = this.res @@ -466,33 +428,27 @@ SendStream.prototype.redirect = function redirect (path) { * @api public */ -SendStream.prototype.pipe = function pipe (res) { - // root path - var root = this._root +SendStream.prototype.pipe = function(res){ + var self = this + , args = arguments + , root = this._root; // references - this.res = res + this.res = res; // decode the path var path = decode(this.path) - if (path === -1) { - this.error(400) - return res - } + if (path === -1) return this.error(400) // null byte(s) - if (~path.indexOf('\0')) { - this.error(400) - return res - } + if (~path.indexOf('\0')) return this.error(400); var parts if (root !== null) { // malicious path - if (UP_PATH_REGEXP.test(normalize('.' + sep + path))) { + if (upPathRegexp.test(normalize('.' + sep + path))) { debug('malicious path "%s"', path) - this.error(403) - return res + return this.error(403) } // join / normalize from optional root dir @@ -503,10 +459,9 @@ SendStream.prototype.pipe = function pipe (res) { parts = path.substr(root.length).split(sep) } else { // ".." is malicious without "root" - if (UP_PATH_REGEXP.test(path)) { + if (upPathRegexp.test(path)) { debug('malicious path "%s"', path) - this.error(403) - return res + return this.error(403) } // explode path parts @@ -532,24 +487,22 @@ SendStream.prototype.pipe = function pipe (res) { case 'allow': break case 'deny': - this.error(403) - return res + return this.error(403) case 'ignore': default: - this.error(404) - return res + return this.error(404) } } // index file support if (this._index.length && this.path[this.path.length - 1] === '/') { - this.sendIndex(path) - return res + this.sendIndex(path); + return res; } - this.sendFile(path) - return res -} + this.sendFile(path); + return res; +}; /** * Transfer `path`. @@ -558,79 +511,74 @@ SendStream.prototype.pipe = function pipe (res) { * @api public */ -SendStream.prototype.send = function send (path, stat) { - var len = stat.size +SendStream.prototype.send = function(path, stat){ + var len = stat.size; var options = this.options var opts = {} - var res = this.res - var req = this.req - var ranges = req.headers.range - var offset = options.start || 0 + var res = this.res; + var req = this.req; + var ranges = req.headers.range; + var offset = options.start || 0; if (res._header) { // impossible to send now - this.headersAlreadySent() - return + return this.headersAlreadySent(); } debug('pipe "%s"', path) // set header fields - this.setHeader(path, stat) + this.setHeader(path, stat); // set content-type - this.type(path) + this.type(path); // conditional GET support - if (this.isConditionalGET() && this.isCachable() && this.isFresh()) { - this.notModified() - return + if (this.isConditionalGET() + && this.isCachable() + && this.isFresh()) { + return this.notModified(); } // adjust len to start/end options - len = Math.max(0, len - offset) + len = Math.max(0, len - offset); if (options.end !== undefined) { - var bytes = options.end - offset + 1 - if (len > bytes) len = bytes + var bytes = options.end - offset + 1; + if (len > bytes) len = bytes; } // Range support - if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { - // parse - ranges = parseRange(len, ranges, { - combine: true - }) + if (ranges) { + ranges = parseRange(len, ranges); // If-Range support if (!this.isRangeFresh()) { - debug('range stale') - ranges = -2 + debug('range stale'); + ranges = -2; } // unsatisfiable - if (ranges === -1) { - debug('range unsatisfiable') - - // Content-Range - res.setHeader('Content-Range', contentRange('bytes', len)) - - // 416 Requested Range Not Satisfiable - return this.error(416, { - headers: {'Content-Range': res.getHeader('Content-Range')} - }) + if (-1 == ranges) { + debug('range unsatisfiable'); + res.setHeader('Content-Range', 'bytes */' + stat.size); + return this.error(416); } // valid (syntactically invalid/multiple ranges are treated as a regular response) - if (ranges !== -2 && ranges.length === 1) { - debug('range %j', ranges) + if (-2 != ranges && ranges.length === 1) { + debug('range %j', ranges); // Content-Range - res.statusCode = 206 - res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) - - // adjust for requested range - offset += ranges[0].start - len = ranges[0].end - ranges[0].start + 1 + res.statusCode = 206; + res.setHeader('Content-Range', 'bytes ' + + ranges[0].start + + '-' + + ranges[0].end + + '/' + + len); + + offset += ranges[0].start; + len = ranges[0].end - ranges[0].start + 1; } } @@ -644,16 +592,13 @@ SendStream.prototype.send = function send (path, stat) { opts.end = Math.max(offset, offset + len - 1) // content-length - res.setHeader('Content-Length', len) + res.setHeader('Content-Length', len); // HEAD support - if (req.method === 'HEAD') { - res.end() - return - } + if ('HEAD' == req.method) return res.end(); this.stream(path, opts) -} +}; /** * Transfer file for `path`. @@ -661,13 +606,15 @@ SendStream.prototype.send = function send (path, stat) { * @param {String} path * @api private */ -SendStream.prototype.sendFile = function sendFile (path) { +SendStream.prototype.sendFile = function sendFile(path) { var i = 0 var self = this - debug('stat "%s"', path) - fs.stat(path, function onstat (err, stat) { - if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) { + debug('stat "%s"', path); + fs.stat(path, function onstat(err, stat) { + if (err && err.code === 'ENOENT' + && !extname(path) + && path[path.length - 1] !== sep) { // not found, check extensions return next(err) } @@ -677,7 +624,7 @@ SendStream.prototype.sendFile = function sendFile (path) { self.send(path, stat) }) - function next (err) { + function next(err) { if (self._extensions.length <= i) { return err ? self.onStatError(err) @@ -702,29 +649,29 @@ SendStream.prototype.sendFile = function sendFile (path) { * @param {String} path * @api private */ -SendStream.prototype.sendIndex = function sendIndex (path) { - var i = -1 - var self = this +SendStream.prototype.sendIndex = function sendIndex(path){ + var i = -1; + var self = this; - function next (err) { + function next(err){ if (++i >= self._index.length) { - if (err) return self.onStatError(err) - return self.error(404) + if (err) return self.onStatError(err); + return self.error(404); } - var p = join(path, self._index[i]) + var p = join(path, self._index[i]); - debug('stat "%s"', p) - fs.stat(p, function (err, stat) { - if (err) return next(err) - if (stat.isDirectory()) return next() - self.emit('file', p, stat) - self.send(p, stat) - }) + debug('stat "%s"', p); + fs.stat(p, function(err, stat){ + if (err) return next(err); + if (stat.isDirectory()) return next(); + self.emit('file', p, stat); + self.send(p, stat); + }); } - next() -} + next(); +}; /** * Stream `path` to the response. @@ -734,41 +681,42 @@ SendStream.prototype.sendIndex = function sendIndex (path) { * @api private */ -SendStream.prototype.stream = function stream (path, options) { +SendStream.prototype.stream = function(path, options){ // TODO: this is all lame, refactor meeee - var finished = false - var self = this - var res = this.res + var finished = false; + var self = this; + var res = this.res; + var req = this.req; // pipe - var stream = fs.createReadStream(path, options) - this.emit('stream', stream) - stream.pipe(res) + var stream = fs.createReadStream(path, options); + this.emit('stream', stream); + stream.pipe(res); // response finished, done with the fd - onFinished(res, function onfinished () { - finished = true - destroy(stream) - }) + onFinished(res, function onfinished(){ + finished = true; + destroy(stream); + }); // error handling code-smell - stream.on('error', function onerror (err) { + stream.on('error', function onerror(err){ // request already finished - if (finished) return + if (finished) return; // clean up stream - finished = true - destroy(stream) + finished = true; + destroy(stream); // error - self.onStatError(err) - }) + self.onStatError(err); + }); // end - stream.on('end', function onend () { - self.emit('end') - }) -} + stream.on('end', function onend(){ + self.emit('end'); + }); +}; /** * Set content-type based on `path` @@ -778,23 +726,14 @@ SendStream.prototype.stream = function stream (path, options) { * @api private */ -SendStream.prototype.type = function type (path) { - var res = this.res - - if (res.getHeader('Content-Type')) return - - var type = mime.lookup(path) - - if (!type) { - debug('no content-type') - return - } - - var charset = mime.charsets.lookup(type) - - debug('content-type %s', type) - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')) -} +SendStream.prototype.type = function(path){ + var res = this.res; + if (res.getHeader('Content-Type')) return; + var type = mime.lookup(path); + var charset = mime.charsets.lookup(type); + debug('content-type %s', type); + res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); +}; /** * Set response header fields, most @@ -805,21 +744,13 @@ SendStream.prototype.type = function type (path) { * @api private */ -SendStream.prototype.setHeader = function setHeader (path, stat) { - var res = this.res - - this.emit('headers', res, path, stat) +SendStream.prototype.setHeader = function setHeader(path, stat){ + var res = this.res; - if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { - debug('accept ranges') - res.setHeader('Accept-Ranges', 'bytes') - } + this.emit('headers', res, path, stat); - if (this._cacheControl && !res.getHeader('Cache-Control')) { - var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) - debug('cache-control %s', cacheControl) - res.setHeader('Cache-Control', cacheControl) - } + if (!res.getHeader('Accept-Ranges')) res.setHeader('Accept-Ranges', 'bytes'); + if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + Math.floor(this._maxage / 1000)); if (this._lastModified && !res.getHeader('Last-Modified')) { var modified = stat.mtime.toUTCString() @@ -832,37 +763,7 @@ SendStream.prototype.setHeader = function setHeader (path, stat) { debug('etag %s', val) res.setHeader('ETag', val) } -} - -/** - * Clear all headers from a response. - * - * @param {object} res - * @private - */ - -function clearHeaders (res) { - res._headers = {} - res._headerNames = {} -} - -/** - * Collapse all leading slashes into a single slash - * - * @param {string} str - * @private - */ -function collapseLeadingSlashes (str) { - for (var i = 0; i < str.length; i++) { - if (str[i] !== '/') { - break - } - } - - return i > 1 - ? '/' + str.substr(i) - : str -} +}; /** * Determine if path parts contain a dotfile. @@ -870,7 +771,7 @@ function collapseLeadingSlashes (str) { * @api private */ -function containsDotFile (parts) { +function containsDotFile(parts) { for (var i = 0; i < parts.length; i++) { if (parts[i][0] === '.') { return true @@ -880,18 +781,6 @@ function containsDotFile (parts) { return false } -/** - * Create a Content-Range header. - * - * @param {string} type - * @param {number} size - * @param {array} [range] - */ - -function contentRange (type, size, range) { - return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size -} - /** * decodeURIComponent. * @@ -902,7 +791,7 @@ function contentRange (type, size, range) { * @api private */ -function decode (path) { +function decode(path) { try { return decodeURIComponent(path) } catch (err) { @@ -918,7 +807,7 @@ function decode (path) { * @private */ -function normalizeList (val, name) { +function normalizeList(val, name) { var list = [].concat(val || []) for (var i = 0; i < list.length; i++) { @@ -929,20 +818,3 @@ function normalizeList (val, name) { return list } - -/** - * Set an object of headers on a response. - * - * @param {object} res - * @param {object} headers - * @private - */ - -function setHeaders (res, headers) { - var keys = Object.keys(headers) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - res.setHeader(key, headers[key]) - } -} diff --git a/node_modules/send/package.json b/node_modules/send/package.json index 3ba4b96..c413752 100644 --- a/node_modules/send/package.json +++ b/node_modules/send/package.json @@ -2,51 +2,47 @@ "_args": [ [ { - "raw": "send@0.14.1", + "raw": "send@0.13.1", "scope": null, "escapedName": "send", "name": "send", - "rawSpec": "0.14.1", - "spec": "0.14.1", + "rawSpec": "0.13.1", + "spec": "0.13.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "send@0.14.1", - "_id": "send@0.14.1", + "_from": "send@0.13.1", + "_id": "send@0.13.1", "_inCache": true, "_installable": true, "_location": "/send", - "_nodeVersion": "4.4.3", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/send-0.14.1.tgz_1465535036412_0.3431496580597013" - }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.15.1", - "_phantomChildren": {}, + "_npmVersion": "1.4.28", + "_phantomChildren": { + "inherits": "2.0.1" + }, "_requested": { - "raw": "send@0.14.1", + "raw": "send@0.13.1", "scope": null, "escapedName": "send", "name": "send", - "rawSpec": "0.14.1", - "spec": "0.14.1", + "rawSpec": "0.13.1", + "spec": "0.13.1", "type": "version" }, "_requiredBy": [ - "/express", - "/serve-static" + "/express" ], - "_resolved": "https://registry.npmjs.org/send/-/send-0.14.1.tgz", - "_shasum": "a954984325392f51532a7760760e459598c89f7a", + "_resolved": "https://registry.npmjs.org/send/-/send-0.13.1.tgz", + "_shasum": "a30d5f4c82c8a9bae9ad00a1d9b1bdbe6f199ed7", "_shrinkwrap": null, - "_spec": "send@0.14.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "send@0.13.1", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -64,32 +60,27 @@ "debug": "~2.2.0", "depd": "~1.1.0", "destroy": "~1.0.4", - "encodeurl": "~1.0.1", "escape-html": "~1.0.3", "etag": "~1.7.0", "fresh": "0.3.0", - "http-errors": "~1.5.0", + "http-errors": "~1.3.1", "mime": "1.3.4", "ms": "0.7.1", "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.3.0" + "range-parser": "~1.0.3", + "statuses": "~1.2.1" }, "description": "Better streaming static file server with Range and conditional-GET support", "devDependencies": { "after": "0.8.1", - "eslint": "2.11.1", - "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.3.1", - "eslint-plugin-standard": "1.3.2", - "istanbul": "0.4.3", - "mocha": "2.5.3", + "istanbul": "0.4.2", + "mocha": "2.3.4", "supertest": "1.1.0" }, "directories": {}, "dist": { - "shasum": "a954984325392f51532a7760760e459598c89f7a", - "tarball": "https://registry.npmjs.org/send/-/send-0.14.1.tgz" + "shasum": "a30d5f4c82c8a9bae9ad00a1d9b1bdbe6f199ed7", + "tarball": "https://registry.npmjs.org/send/-/send-0.13.1.tgz" }, "engines": { "node": ">= 0.8.0" @@ -100,8 +91,8 @@ "README.md", "index.js" ], - "gitHead": "d6dd3b91bbb73ad89f1398fa227b200db9bff037", - "homepage": "https://github.com/pillarjs/send#readme", + "gitHead": "dbce43fc7102c14b475c25cde918b726063cc991", + "homepage": "https://github.com/pillarjs/send", "keywords": [ "static", "file", @@ -109,6 +100,10 @@ ], "license": "MIT", "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -122,10 +117,9 @@ "url": "git+https://github.com/pillarjs/send.git" }, "scripts": { - "lint": "eslint **/*.js", "test": "mocha --check-leaks --reporter spec --bail", "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot" }, - "version": "0.14.1" + "version": "0.13.1" } diff --git a/node_modules/serve-static/HISTORY.md b/node_modules/serve-static/HISTORY.md index 0256dbb..b34fe9f 100644 --- a/node_modules/serve-static/HISTORY.md +++ b/node_modules/serve-static/HISTORY.md @@ -1,26 +1,3 @@ -1.11.1 / 2016-06-10 -=================== - - * Fix redirect error when `req.url` contains raw non-URL characters - * deps: send@0.14.1 - -1.11.0 / 2016-06-07 -=================== - - * Use status code 301 for redirects - * deps: send@0.14.0 - - Add `acceptRanges` option - - Add `cacheControl` option - - Attempt to combine multiple ranges into single range - - Correctly inherit from `Stream` class - - Fix `Content-Range` header in 416 responses when using `start`/`end` options - - Fix `Content-Range` header missing from default 416 responses - - Ignore non-byte `Range` headers - - deps: http-errors@~1.5.0 - - deps: range-parser@~1.2.0 - - deps: statuses@~1.3.0 - - perf: remove argument reassignment - 1.10.3 / 2016-05-30 =================== diff --git a/node_modules/serve-static/LICENSE b/node_modules/serve-static/LICENSE index cbe62e8..d8cce67 100644 --- a/node_modules/serve-static/LICENSE +++ b/node_modules/serve-static/LICENSE @@ -3,7 +3,7 @@ Copyright (c) 2010 Sencha Inc. Copyright (c) 2011 LearnBoost Copyright (c) 2011 TJ Holowaychuk -Copyright (c) 2014-2016 Douglas Christopher Wilson +Copyright (c) 2014-2015 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/serve-static/README.md b/node_modules/serve-static/README.md index 3bd75f3..62104b1 100644 --- a/node_modules/serve-static/README.md +++ b/node_modules/serve-static/README.md @@ -29,17 +29,6 @@ to the next middleware, allowing for stacking and fall-backs. #### Options -##### acceptRanges - -Enable or disable accepting ranged requests, defaults to true. -Disabling this will not send `Accept-Ranges` and ignore the contents -of the `Range` request header. - -##### cacheControl - -Enable or disable setting `Cache-Control` response header, defaults to -true. Disabling this will ignore the `maxAge` option. - ##### dotfiles Set how "dotfiles" are treated when encountered. A dotfile is a file @@ -131,8 +120,9 @@ var serveStatic = require('serve-static') var serve = serveStatic('public/ftp', {'index': ['index.html', 'index.htm']}) // Create server -var server = http.createServer(function onRequest (req, res) { - serve(req, res, finalhandler(req, res)) +var server = http.createServer(function(req, res){ + var done = finalhandler(req, res) + serve(req, res, done) }) // Listen @@ -159,8 +149,9 @@ function setHeaders(res, path) { } // Create server -var server = http.createServer(function onRequest (req, res) { - serve(req, res, finalhandler(req, res)) +var server = http.createServer(function(req, res){ + var done = finalhandler(req, res) + serve(req, res, done) }) // Listen @@ -219,7 +210,7 @@ app.use(serveStatic(__dirname + '/public', { app.listen(3000) -function setCustomCacheControl (res, path) { +function setCustomCacheControl(res, path) { if (serveStatic.mime.lookup(path) === 'text/html') { // Custom Cache-Control for HTML files res.setHeader('Cache-Control', 'public, max-age=0') diff --git a/node_modules/serve-static/index.js b/node_modules/serve-static/index.js index 83c5e4f..5cebe74 100644 --- a/node_modules/serve-static/index.js +++ b/node_modules/serve-static/index.js @@ -2,7 +2,7 @@ * serve-static * Copyright(c) 2010 Sencha Inc. * Copyright(c) 2011 TJ Holowaychuk - * Copyright(c) 2014-2016 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -13,7 +13,6 @@ * @private */ -var encodeUrl = require('encodeurl') var escapeHtml = require('escape-html') var parseUrl = require('parseurl') var resolve = require('path').resolve @@ -173,12 +172,12 @@ function createRedirectDirectoryListener () { originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/') // reformat the URL - var loc = encodeUrl(url.format(originalUrl)) + var loc = url.format(originalUrl) var msg = 'Redirecting to ' + escapeHtml(loc) + '\n' var res = this.res // send redirect response - res.statusCode = 301 + res.statusCode = 303 res.setHeader('Content-Type', 'text/html; charset=UTF-8') res.setHeader('Content-Length', Buffer.byteLength(msg)) res.setHeader('X-Content-Type-Options', 'nosniff') diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json index a548e05..1871ed5 100644 --- a/node_modules/serve-static/package.json +++ b/node_modules/serve-static/package.json @@ -2,50 +2,62 @@ "_args": [ [ { - "raw": "serve-static@~1.11.1", + "raw": "serve-static@~1.10.2", "scope": null, "escapedName": "serve-static", "name": "serve-static", - "rawSpec": "~1.11.1", - "spec": ">=1.11.1 <1.12.0", + "rawSpec": "~1.10.2", + "spec": ">=1.10.2 <1.11.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "serve-static@>=1.11.1 <1.12.0", - "_id": "serve-static@1.11.1", + "_from": "serve-static@>=1.10.2 <1.11.0", + "_id": "serve-static@1.10.3", "_inCache": true, "_installable": true, "_location": "/serve-static", "_nodeVersion": "4.4.3", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/serve-static-1.11.1.tgz_1465608601758_0.0030737747438251972" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/serve-static-1.10.3.tgz_1464664781274_0.7150349044241011" }, "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "_npmVersion": "2.15.1", - "_phantomChildren": {}, + "_phantomChildren": { + "debug": "2.2.0", + "depd": "1.1.0", + "destroy": "1.0.4", + "escape-html": "1.0.3", + "etag": "1.7.0", + "fresh": "0.3.0", + "inherits": "2.0.1", + "mime": "1.3.4", + "ms": "0.7.1", + "on-finished": "2.3.0", + "range-parser": "1.0.3" + }, "_requested": { - "raw": "serve-static@~1.11.1", + "raw": "serve-static@~1.10.2", "scope": null, "escapedName": "serve-static", "name": "serve-static", - "rawSpec": "~1.11.1", - "spec": ">=1.11.1 <1.12.0", + "rawSpec": "~1.10.2", + "spec": ">=1.10.2 <1.11.0", "type": "range" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.11.1.tgz", - "_shasum": "d6cce7693505f733c759de57befc1af76c0f0805", + "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz", + "_shasum": "ce5a6ecd3101fed5ec09827dac22a9c29bfb0535", "_shrinkwrap": null, - "_spec": "serve-static@~1.11.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "serve-static@~1.10.2", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" @@ -54,16 +66,15 @@ "url": "https://github.com/expressjs/serve-static/issues" }, "dependencies": { - "encodeurl": "~1.0.1", "escape-html": "~1.0.3", "parseurl": "~1.3.1", - "send": "0.14.1" + "send": "0.13.2" }, "description": "Serve static files", "devDependencies": { "eslint": "2.11.1", "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.3.2", + "eslint-plugin-promise": "1.3.1", "eslint-plugin-standard": "1.3.2", "istanbul": "0.4.3", "mocha": "2.5.3", @@ -71,8 +82,8 @@ }, "directories": {}, "dist": { - "shasum": "d6cce7693505f733c759de57befc1af76c0f0805", - "tarball": "https://registry.npmjs.org/serve-static/-/serve-static-1.11.1.tgz" + "shasum": "ce5a6ecd3101fed5ec09827dac22a9c29bfb0535", + "tarball": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz" }, "engines": { "node": ">= 0.8.0" @@ -82,7 +93,7 @@ "HISTORY.md", "index.js" ], - "gitHead": "b3a24df138ea2f2c43afcbee0dcce5badf4c78ae", + "gitHead": "8be028d005967471832109d777daa4b45bd1948b", "homepage": "https://github.com/expressjs/serve-static#readme", "license": "MIT", "maintainers": [ @@ -104,5 +115,5 @@ "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" }, - "version": "1.11.1" + "version": "1.10.3" } diff --git a/node_modules/setprototypeof/package.json b/node_modules/setprototypeof/package.json index 1147b2c..02c8092 100644 --- a/node_modules/setprototypeof/package.json +++ b/node_modules/setprototypeof/package.json @@ -10,7 +10,7 @@ "spec": "1.0.1", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/http-errors" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/http-errors" ] ], "_from": "setprototypeof@1.0.1", @@ -45,7 +45,7 @@ "_shasum": "52009b27888c4dc48f591949c0a8275834c1ca7e", "_shrinkwrap": null, "_spec": "setprototypeof@1.0.1", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/http-errors", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/http-errors", "author": { "name": "Wes Todd" }, diff --git a/node_modules/statuses/package.json b/node_modules/statuses/package.json index 3611ef1..3654d04 100644 --- a/node_modules/statuses/package.json +++ b/node_modules/statuses/package.json @@ -2,18 +2,18 @@ "_args": [ [ { - "raw": "statuses@~1.3.0", + "raw": "statuses@>= 1.3.0 < 2", "scope": null, "escapedName": "statuses", "name": "statuses", - "rawSpec": "~1.3.0", - "spec": ">=1.3.0 <1.4.0", + "rawSpec": ">= 1.3.0 < 2", + "spec": ">=1.3.0 <2.0.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/finalhandler" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/http-errors" ] ], - "_from": "statuses@>=1.3.0 <1.4.0", + "_from": "statuses@>=1.3.0 <2.0.0", "_id": "statuses@1.3.0", "_inCache": true, "_installable": true, @@ -29,24 +29,22 @@ "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "statuses@~1.3.0", + "raw": "statuses@>= 1.3.0 < 2", "scope": null, "escapedName": "statuses", "name": "statuses", - "rawSpec": "~1.3.0", - "spec": ">=1.3.0 <1.4.0", + "rawSpec": ">= 1.3.0 < 2", + "spec": ">=1.3.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/finalhandler", - "/http-errors", - "/send" + "/http-errors" ], "_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.0.tgz", "_shasum": "8e55758cb20e7682c1f4fce8dcab30bf01d1e07a", "_shrinkwrap": null, - "_spec": "statuses@~1.3.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/finalhandler", + "_spec": "statuses@>= 1.3.0 < 2", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/http-errors", "bugs": { "url": "https://github.com/jshttp/statuses/issues" }, diff --git a/node_modules/type-is/package.json b/node_modules/type-is/package.json index 289b74e..0ebaf8c 100644 --- a/node_modules/type-is/package.json +++ b/node_modules/type-is/package.json @@ -10,7 +10,7 @@ "spec": ">=1.6.13 <1.7.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser" ] ], "_from": "type-is@>=1.6.13 <1.7.0", @@ -39,13 +39,14 @@ "type": "range" }, "_requiredBy": [ + "/body-parser", "/express" ], "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.13.tgz", "_shasum": "6e83ba7bc30cd33a7bb0b7fb00737a2085bf9d08", "_shrinkwrap": null, "_spec": "type-is@~1.6.13", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/body-parser", "bugs": { "url": "https://github.com/jshttp/type-is/issues" }, diff --git a/node_modules/unpipe/package.json b/node_modules/unpipe/package.json index 9712ae0..94fe268 100644 --- a/node_modules/unpipe/package.json +++ b/node_modules/unpipe/package.json @@ -2,18 +2,18 @@ "_args": [ [ { - "raw": "unpipe@~1.0.0", + "raw": "unpipe@1.0.0", "scope": null, "escapedName": "unpipe", "name": "unpipe", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/finalhandler" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/raw-body" ] ], - "_from": "unpipe@>=1.0.0 <1.1.0", + "_from": "unpipe@1.0.0", "_id": "unpipe@1.0.0", "_inCache": true, "_installable": true, @@ -25,22 +25,23 @@ "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "unpipe@~1.0.0", + "raw": "unpipe@1.0.0", "scope": null, "escapedName": "unpipe", "name": "unpipe", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" }, "_requiredBy": [ - "/finalhandler" + "/finalhandler", + "/raw-body" ], "_resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "_shasum": "b2bf4ee8514aae6165b4817829d21b2ef49904ec", "_shrinkwrap": null, - "_spec": "unpipe@~1.0.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/finalhandler", + "_spec": "unpipe@1.0.0", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/raw-body", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" diff --git a/node_modules/utils-merge/package.json b/node_modules/utils-merge/package.json index 22cda5c..e908de9 100644 --- a/node_modules/utils-merge/package.json +++ b/node_modules/utils-merge/package.json @@ -10,7 +10,7 @@ "spec": "1.0.0", "type": "version" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], "_from": "utils-merge@1.0.0", @@ -40,7 +40,7 @@ "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8", "_shrinkwrap": null, "_spec": "utils-merge@1.0.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Jared Hanson", "email": "jaredhanson@gmail.com", diff --git a/node_modules/vary/HISTORY.md b/node_modules/vary/HISTORY.md index ed68118..cddbcd4 100644 --- a/node_modules/vary/HISTORY.md +++ b/node_modules/vary/HISTORY.md @@ -1,9 +1,3 @@ -1.1.0 / 2015-09-29 -================== - - * Only accept valid field names in the `field` argument - - Ensures the resulting string is a valid HTTP header value - 1.0.1 / 2015-07-08 ================== diff --git a/node_modules/vary/index.js b/node_modules/vary/index.js index 21dbaf1..e818dbb 100644 --- a/node_modules/vary/index.js +++ b/node_modules/vary/index.js @@ -14,17 +14,10 @@ module.exports = vary; module.exports.append = append; /** - * RegExp to match field-name in RFC 7230 sec 3.2 - * - * field-name = token - * token = 1*tchar - * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" - * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" - * / DIGIT / ALPHA - * ; any VCHAR, except delimiters + * Variables. */ -var fieldNameRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/ +var separators = /[\(\)<>@,;:\\"\/\[\]\?=\{\}\u0020\u0009]/; /** * Append a field to a vary header. @@ -49,10 +42,10 @@ function append(header, field) { ? parse(String(field)) : field; - // assert on invalid field names + // assert on invalid fields for (var i = 0; i < fields.length; i++) { - if (!fieldNameRegExp.test(fields[i])) { - throw new TypeError('field argument contains an invalid header name'); + if (separators.test(fields[i])) { + throw new TypeError('field argument contains an invalid header'); } } diff --git a/node_modules/vary/package.json b/node_modules/vary/package.json index e753550..caa89e1 100644 --- a/node_modules/vary/package.json +++ b/node_modules/vary/package.json @@ -2,19 +2,19 @@ "_args": [ [ { - "raw": "vary@~1.1.0", + "raw": "vary@~1.0.1", "scope": null, "escapedName": "vary", "name": "vary", - "rawSpec": "~1.1.0", - "spec": ">=1.1.0 <1.2.0", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", "type": "range" }, - "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express" + "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express" ] ], - "_from": "vary@>=1.1.0 <1.2.0", - "_id": "vary@1.1.0", + "_from": "vary@>=1.0.1 <1.1.0", + "_id": "vary@1.0.1", "_inCache": true, "_installable": true, "_location": "/vary", @@ -25,22 +25,22 @@ "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "raw": "vary@~1.1.0", + "raw": "vary@~1.0.1", "scope": null, "escapedName": "vary", "name": "vary", - "rawSpec": "~1.1.0", - "spec": ">=1.1.0 <1.2.0", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", "type": "range" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/vary/-/vary-1.1.0.tgz", - "_shasum": "e1e5affbbd16ae768dd2674394b9ad3022653140", + "_resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz", + "_shasum": "99e4981566a286118dfb2b817357df7993376d10", "_shrinkwrap": null, - "_spec": "vary@~1.1.0", - "_where": "/Users/AmeliaC/Documents/guildprojects/freezing_ringtail/freezing-ringtail/node_modules/express", + "_spec": "vary@~1.0.1", + "_where": "/Users/ideans/Documents/developer/freezing-ringtail/freezing-ringtail/node_modules/express", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" @@ -51,14 +51,14 @@ "dependencies": {}, "description": "Manipulate the HTTP Vary header", "devDependencies": { - "istanbul": "0.3.21", - "mocha": "2.3.3", - "supertest": "1.1.0" + "istanbul": "0.3.17", + "mocha": "2.2.5", + "supertest": "1.0.1" }, "directories": {}, "dist": { - "shasum": "e1e5affbbd16ae768dd2674394b9ad3022653140", - "tarball": "https://registry.npmjs.org/vary/-/vary-1.1.0.tgz" + "shasum": "99e4981566a286118dfb2b817357df7993376d10", + "tarball": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz" }, "engines": { "node": ">= 0.8" @@ -69,7 +69,7 @@ "README.md", "index.js" ], - "gitHead": "13b03e9bf97da9d83bfeac84d84144137d84c257", + "gitHead": "650282ff8e614731837040a23e10f51c20728392", "homepage": "https://github.com/jshttp/vary", "keywords": [ "http", @@ -103,5 +103,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "version": "1.1.0" + "version": "1.0.1" } diff --git a/package.json b/package.json index f714e5c..51e0599 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,17 @@ { "name": "freezing-ringtail", - "version": "1.0.0", - "description": "Simple Bookstore App to learn about SQL", - "main": "index.js", + "version": "0.0.0", + "private": true, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node ./bin/www" }, - "repository": { - "type": "git", - "url": "git+https://github.com/ameliavoncat/freezing-ringtail.git" - }, - "keywords": [ - "sql" - ], - "author": "freezing-ringtail", - "license": "ISC", - "bugs": { - "url": "https://github.com/ameliavoncat/freezing-ringtail/issues" - }, - "homepage": "https://github.com/ameliavoncat/freezing-ringtail#readme", "dependencies": { - "express": "^4.14.0" + "body-parser": "~1.15.1", + "cookie-parser": "~1.4.3", + "debug": "~2.2.0", + "express": "~4.13.4", + "hbs": "~4.0.0", + "morgan": "~1.7.0", + "serve-favicon": "~2.3.0" } } diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css new file mode 100644 index 0000000..9453385 --- /dev/null +++ b/public/stylesheets/style.css @@ -0,0 +1,8 @@ +body { + padding: 50px; + font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; +} + +a { + color: #00B7FF; +} diff --git a/routes/index.js b/routes/index.js new file mode 100644 index 0000000..ecca96a --- /dev/null +++ b/routes/index.js @@ -0,0 +1,9 @@ +var express = require('express'); +var router = express.Router(); + +/* GET home page. */ +router.get('/', function(req, res, next) { + res.render('index', { title: 'Express' }); +}); + +module.exports = router; diff --git a/routes/users.js b/routes/users.js new file mode 100644 index 0000000..623e430 --- /dev/null +++ b/routes/users.js @@ -0,0 +1,9 @@ +var express = require('express'); +var router = express.Router(); + +/* GET users listing. */ +router.get('/', function(req, res, next) { + res.send('respond with a resource'); +}); + +module.exports = router; diff --git a/views/error.hbs b/views/error.hbs new file mode 100644 index 0000000..0659765 --- /dev/null +++ b/views/error.hbs @@ -0,0 +1,3 @@ +

{{message}}

+

{{error.status}}

+
{{error.stack}}
diff --git a/views/index.hbs b/views/index.hbs new file mode 100644 index 0000000..1f308fd --- /dev/null +++ b/views/index.hbs @@ -0,0 +1,2 @@ +

{{title}}

+

Welcome to {{title}}

diff --git a/views/layout.hbs b/views/layout.hbs new file mode 100644 index 0000000..068eb6b --- /dev/null +++ b/views/layout.hbs @@ -0,0 +1,10 @@ + + + + {{title}} + + + + {{{body}}} + + From ed25c76251c1cd1eb14fef2487622b49ce1e67d3 Mon Sep 17 00:00:00 2001 From: Najee Amaranth Date: Mon, 3 Oct 2016 11:40:21 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b954460..1032a5c 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,12 @@ Creating this web application will provide exposure to: - [ ] Books entered in the system are listed on the home page, in pages of 10 - [ ] Users can search for books by title OR by author OR by genre, and search results will be presented in a new page - [ ] Users can view book details on a book detail page, linked to from the listing or search pages -- [ ] All code submissions are peer reviewed via GitHub PR by at least two members of the team, and master is always in a stable state (tests passed, site functions) +- [ ] Store books in Postgres database +- [ ] Uses express framework ### Required -- [ ] The artifact produced is properly licensed, preferably with the [MIT license][mit-license]. +- [x] The artifact produced is properly licensed, preferably with the [MIT license][mit-license]. ## Quality Rubric @@ -28,7 +29,6 @@ Creating this web application will provide exposure to: - Variables, functions, css classes, etc. are meaningfully named (no comments exist in code to explain functionality - the names serve that function) - Functions are small and serve a single purpose - Code is well organized into a meaningful file structure -- Code is reasonably tested with a test suite - Interface is user friendly ## Resources