From efb3bbf582d6b6765c5ad7292a80a5596efa2e74 Mon Sep 17 00:00:00 2001 From: "PRARTHANA\\prarthana" Date: Sun, 28 Nov 2021 18:40:53 +0530 Subject: [PATCH] add login --- .idea/.gitignore | 8 + .idea/NewsBlog.iml | 9 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/runConfigurations.xml | 10 + .idea/vcs.xml | 6 + node_modules/body-parser/HISTORY.md | 21 -- node_modules/body-parser/README.md | 2 + .../body-parser/lib/types/urlencoded.js | 2 +- node_modules/body-parser/package.json | 52 +-- node_modules/bytes/History.md | 5 - node_modules/bytes/Readme.md | 13 +- node_modules/bytes/index.js | 9 +- node_modules/bytes/package.json | 28 +- node_modules/content-disposition/HISTORY.md | 5 - node_modules/content-disposition/LICENSE | 2 +- node_modules/content-disposition/README.md | 23 +- node_modules/content-disposition/index.js | 47 +-- node_modules/content-disposition/package.json | 51 ++- node_modules/express/History.md | 74 +--- node_modules/express/Readme.md | 14 +- node_modules/express/lib/express.js | 2 - node_modules/express/lib/request.js | 4 - node_modules/express/lib/response.js | 7 +- .../express/node_modules/cookie/HISTORY.md | 118 ++++++ .../express/node_modules/cookie/LICENSE | 24 ++ .../express/node_modules/cookie/README.md | 220 ++++++++++++ .../express/node_modules/cookie/index.js | 195 ++++++++++ .../express/node_modules/cookie/package.json | 71 ++++ node_modules/express/package.json | 64 ++-- node_modules/finalhandler/HISTORY.md | 7 - node_modules/finalhandler/README.md | 2 +- node_modules/finalhandler/index.js | 2 +- node_modules/finalhandler/package.json | 50 +-- node_modules/http-errors/HISTORY.md | 19 +- node_modules/http-errors/README.md | 54 +-- node_modules/http-errors/index.js | 28 +- node_modules/http-errors/package.json | 47 ++- node_modules/iconv-lite/.travis.yml | 23 ++ node_modules/iconv-lite/Changelog.md | 4 - .../iconv-lite/encodings/sbcs-codec.js | 4 +- .../iconv-lite/encodings/sbcs-data.js | 5 - node_modules/iconv-lite/package.json | 24 +- node_modules/mime/.npmignore | 0 node_modules/mime/CHANGELOG.md | 164 --------- node_modules/mime/build/build.js | 11 + node_modules/mime/{src => build}/test.js | 2 +- node_modules/mime/package.json | 34 +- node_modules/mime/src/build.js | 53 --- node_modules/mime/types.json | 2 +- node_modules/qs/.editorconfig | 2 +- node_modules/qs/.eslintrc | 6 +- node_modules/qs/CHANGELOG.md | 30 -- node_modules/qs/README.md | 101 +----- node_modules/qs/dist/qs.js | 338 +++++------------- node_modules/qs/lib/parse.js | 118 ++---- node_modules/qs/lib/stringify.js | 161 +++------ node_modules/qs/lib/utils.js | 59 ++- node_modules/qs/package.json | 46 ++- node_modules/qs/test/.eslintrc | 2 - node_modules/qs/test/parse.js | 108 +----- node_modules/qs/test/stringify.js | 86 +---- node_modules/qs/test/utils.js | 102 ------ node_modules/raw-body/HISTORY.md | 14 +- node_modules/raw-body/package.json | 46 +-- node_modules/routes/.npmignore | 1 + node_modules/routes/Makefile | 5 + node_modules/routes/README.md | 171 +++++++++ node_modules/routes/dist/routes.js | 184 ++++++++++ node_modules/routes/index.js | 179 ++++++++++ node_modules/routes/package.json | 58 +++ node_modules/routes/test/example.js | 13 + node_modules/routes/test/next.js | 108 ++++++ node_modules/routes/test/test.js | 273 ++++++++++++++ node_modules/send/HISTORY.md | 34 -- node_modules/send/README.md | 65 ++-- node_modules/send/index.js | 7 +- node_modules/send/node_modules/ms/index.js | 162 --------- node_modules/send/node_modules/ms/license.md | 21 -- .../send/node_modules/ms/package.json | 69 ---- node_modules/send/node_modules/ms/readme.md | 60 ---- node_modules/send/package.json | 50 +-- node_modules/serve-static/HISTORY.md | 18 - node_modules/serve-static/README.md | 25 +- node_modules/serve-static/index.js | 4 +- node_modules/serve-static/package.json | 48 ++- node_modules/setprototypeof/README.md | 23 +- node_modules/setprototypeof/index.js | 24 +- node_modules/setprototypeof/package.json | 35 +- node_modules/setprototypeof/test/index.js | 24 -- node_modules/statuses/HISTORY.md | 5 - node_modules/statuses/codes.json | 1 - node_modules/statuses/package.json | 32 +- node_modules/toidentifier/LICENSE | 21 -- node_modules/toidentifier/README.md | 61 ---- node_modules/toidentifier/index.js | 30 -- node_modules/toidentifier/package.json | 76 ---- package-lock.json | 180 +++++----- package.json | 5 +- server/models/user.js | 14 + server/routes/recipeRoutes.js | 144 +++++++- views/data.ejs | 29 ++ views/forget.ejs | 70 ++++ views/login.ejs | 68 ++++ views/reg.ejs | 69 ++++ 105 files changed, 2822 insertions(+), 2498 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/NewsBlog.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 .idea/vcs.xml create mode 100644 node_modules/express/node_modules/cookie/HISTORY.md create mode 100644 node_modules/express/node_modules/cookie/LICENSE create mode 100644 node_modules/express/node_modules/cookie/README.md create mode 100644 node_modules/express/node_modules/cookie/index.js create mode 100644 node_modules/express/node_modules/cookie/package.json create mode 100644 node_modules/iconv-lite/.travis.yml delete mode 100644 node_modules/mime/.npmignore delete mode 100644 node_modules/mime/CHANGELOG.md create mode 100644 node_modules/mime/build/build.js rename node_modules/mime/{src => build}/test.js (97%) delete mode 100644 node_modules/mime/src/build.js create mode 100644 node_modules/routes/.npmignore create mode 100644 node_modules/routes/Makefile create mode 100644 node_modules/routes/README.md create mode 100644 node_modules/routes/dist/routes.js create mode 100644 node_modules/routes/index.js create mode 100644 node_modules/routes/package.json create mode 100644 node_modules/routes/test/example.js create mode 100644 node_modules/routes/test/next.js create mode 100644 node_modules/routes/test/test.js delete mode 100644 node_modules/send/node_modules/ms/index.js delete mode 100644 node_modules/send/node_modules/ms/license.md delete mode 100644 node_modules/send/node_modules/ms/package.json delete mode 100644 node_modules/send/node_modules/ms/readme.md delete mode 100644 node_modules/setprototypeof/test/index.js delete mode 100644 node_modules/toidentifier/LICENSE delete mode 100644 node_modules/toidentifier/README.md delete mode 100644 node_modules/toidentifier/index.js delete mode 100644 node_modules/toidentifier/package.json create mode 100644 server/models/user.js create mode 100644 views/data.ejs create mode 100644 views/forget.ejs create mode 100644 views/login.ejs create mode 100644 views/reg.ejs diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/NewsBlog.iml b/.idea/NewsBlog.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/NewsBlog.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..80cf6e7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md index a1d3fbf..d8152cc 100644 --- a/node_modules/body-parser/HISTORY.md +++ b/node_modules/body-parser/HISTORY.md @@ -1,24 +1,3 @@ -1.19.0 / 2019-04-25 -=================== - - * deps: bytes@3.1.0 - - Add petabyte (`pb`) support - * deps: http-errors@1.7.2 - - Set constructor name when possible - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: iconv-lite@0.4.24 - - Added encoding MIK - * deps: qs@6.7.0 - - Fix parsing array brackets after index - * deps: raw-body@2.4.0 - - deps: bytes@3.1.0 - - deps: http-errors@1.7.2 - - deps: iconv-lite@0.4.24 - * deps: type-is@~1.6.17 - - deps: mime-types@~2.1.24 - - perf: prevent internal `throw` on invalid type - 1.18.3 / 2018-05-14 =================== diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md index aba6297..d9138bc 100644 --- a/node_modules/body-parser/README.md +++ b/node_modules/body-parser/README.md @@ -399,11 +399,13 @@ var urlencodedParser = bodyParser.urlencoded({ extended: false }) // POST /login gets urlencoded bodies app.post('/login', urlencodedParser, function (req, res) { + if (!req.body) return res.sendStatus(400) res.send('welcome, ' + req.body.username) }) // POST /api/users gets JSON bodies app.post('/api/users', jsonParser, function (req, res) { + if (!req.body) return res.sendStatus(400) // create user in req.body }) ``` diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js index b2ca8f1..5ccda21 100644 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ b/node_modules/body-parser/lib/types/urlencoded.js @@ -266,7 +266,7 @@ function simpleparser (options) { } debug('parse urlencoding') - return parse(body, undefined, undefined, { maxKeys: parameterLimit }) + return parse(body, undefined, undefined, {maxKeys: parameterLimit}) } } diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json index 0485ca7..5aed4ac 100644 --- a/node_modules/body-parser/package.json +++ b/node_modules/body-parser/package.json @@ -1,27 +1,27 @@ { - "_from": "body-parser@1.19.0", - "_id": "body-parser@1.19.0", + "_from": "body-parser@1.18.3", + "_id": "body-parser@1.18.3", "_inBundle": false, - "_integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "_integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", "_location": "/body-parser", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "body-parser@1.19.0", + "raw": "body-parser@1.18.3", "name": "body-parser", "escapedName": "body-parser", - "rawSpec": "1.19.0", + "rawSpec": "1.18.3", "saveSpec": null, - "fetchSpec": "1.19.0" + "fetchSpec": "1.18.3" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "_shasum": "96b2709e57c9c4e09a6fd66a8fd979844f69f08a", - "_spec": "body-parser@1.19.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "_shasum": "5b292198ffdd553b3a0f20ded0592b956955c8b4", + "_spec": "body-parser@1.18.3", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "bugs": { "url": "https://github.com/expressjs/body-parser/issues" }, @@ -38,32 +38,32 @@ } ], "dependencies": { - "bytes": "3.1.0", + "bytes": "3.0.0", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" }, "deprecated": false, "description": "Node.js body parsing middleware", "devDependencies": { - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "4.19.1", + "eslint-config-standard": "11.0.0", + "eslint-plugin-import": "2.11.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "6.0.1", + "eslint-plugin-promise": "3.7.0", + "eslint-plugin-standard": "3.1.0", "istanbul": "0.4.5", "methods": "1.1.2", - "mocha": "6.1.4", + "mocha": "2.5.3", "safe-buffer": "5.1.2", - "supertest": "4.0.2" + "supertest": "1.1.0" }, "engines": { "node": ">= 0.8" @@ -87,5 +87,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/" }, - "version": "1.19.0" + "version": "1.18.3" } diff --git a/node_modules/bytes/History.md b/node_modules/bytes/History.md index cf6a5bb..13d463a 100644 --- a/node_modules/bytes/History.md +++ b/node_modules/bytes/History.md @@ -1,8 +1,3 @@ -3.1.0 / 2019-01-22 -================== - - * Add petabyte (`pb`) support - 3.0.0 / 2017-08-31 ================== diff --git a/node_modules/bytes/Readme.md b/node_modules/bytes/Readme.md index 6ad1ec6..9b53745 100644 --- a/node_modules/bytes/Readme.md +++ b/node_modules/bytes/Readme.md @@ -83,7 +83,6 @@ Supported units and abbreviations are as follows and are case-insensitive: * `mb` for megabytes * `gb` for gigabytes * `tb` for terabytes - * `pb` for petabytes The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. @@ -109,18 +108,18 @@ bytes('1024'); // output: 1024 bytes(1024); -// output: 1KB +// output: 1024 ``` ## License [MIT](LICENSE) -[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master -[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master -[downloads-image]: https://badgen.net/npm/dm/bytes +[downloads-image]: https://img.shields.io/npm/dm/bytes.svg [downloads-url]: https://npmjs.org/package/bytes -[npm-image]: https://badgen.net/npm/node/bytes +[npm-image]: https://img.shields.io/npm/v/bytes.svg [npm-url]: https://npmjs.org/package/bytes -[travis-image]: https://badgen.net/travis/visionmedia/bytes.js/master +[travis-image]: https://img.shields.io/travis/visionmedia/bytes.js/master.svg [travis-url]: https://travis-ci.org/visionmedia/bytes.js +[coveralls-image]: https://img.shields.io/coveralls/visionmedia/bytes.js/master.svg +[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master diff --git a/node_modules/bytes/index.js b/node_modules/bytes/index.js index 4975bfb..1e39afd 100644 --- a/node_modules/bytes/index.js +++ b/node_modules/bytes/index.js @@ -30,11 +30,10 @@ var map = { kb: 1 << 10, mb: 1 << 20, gb: 1 << 30, - tb: Math.pow(1024, 4), - pb: Math.pow(1024, 5), + tb: ((1 << 30) * 1024) }; -var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; +var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i; /** * Convert the given value in bytes into a string or parse to string to an integer in bytes. @@ -94,9 +93,7 @@ function format(value, options) { var unit = (options && options.unit) || ''; if (!unit || !map[unit.toLowerCase()]) { - if (mag >= map.pb) { - unit = 'PB'; - } else if (mag >= map.tb) { + if (mag >= map.tb) { unit = 'TB'; } else if (mag >= map.gb) { unit = 'GB'; diff --git a/node_modules/bytes/package.json b/node_modules/bytes/package.json index 655af95..2d8b083 100644 --- a/node_modules/bytes/package.json +++ b/node_modules/bytes/package.json @@ -1,28 +1,28 @@ { - "_from": "bytes@3.1.0", - "_id": "bytes@3.1.0", + "_from": "bytes@3.0.0", + "_id": "bytes@3.0.0", "_inBundle": false, - "_integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "_integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", "_location": "/bytes", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "bytes@3.1.0", + "raw": "bytes@3.0.0", "name": "bytes", "escapedName": "bytes", - "rawSpec": "3.1.0", + "rawSpec": "3.0.0", "saveSpec": null, - "fetchSpec": "3.1.0" + "fetchSpec": "3.0.0" }, "_requiredBy": [ "/body-parser", "/raw-body" ], - "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "_shasum": "f6cf7933a360e0588fa9fde85651cdc7f805d1f6", - "_spec": "bytes@3.1.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\body-parser", + "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "_shasum": "d32815404d689699f85a4ea4fa8755dd13a96048", + "_spec": "bytes@3.0.0", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\body-parser", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca", @@ -45,9 +45,8 @@ "deprecated": false, "description": "Utility to parse a string bytes to bytes and vice-versa", "devDependencies": { - "eslint": "5.12.1", - "mocha": "5.2.0", - "nyc": "13.1.0" + "mocha": "2.5.3", + "nyc": "10.3.2" }, "engines": { "node": ">= 0.8" @@ -75,10 +74,9 @@ "url": "git+https://github.com/visionmedia/bytes.js.git" }, "scripts": { - "lint": "eslint .", "test": "mocha --check-leaks --reporter spec", "test-ci": "nyc --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test" }, - "version": "3.1.0" + "version": "3.0.0" } diff --git a/node_modules/content-disposition/HISTORY.md b/node_modules/content-disposition/HISTORY.md index 63a3d08..53849b6 100644 --- a/node_modules/content-disposition/HISTORY.md +++ b/node_modules/content-disposition/HISTORY.md @@ -1,8 +1,3 @@ -0.5.3 / 2018-12-17 -================== - - * Use `safe-buffer` for improved Buffer API - 0.5.2 / 2016-12-08 ================== diff --git a/node_modules/content-disposition/LICENSE b/node_modules/content-disposition/LICENSE index 84441fb..b7dce6c 100644 --- a/node_modules/content-disposition/LICENSE +++ b/node_modules/content-disposition/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2017 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/content-disposition/README.md b/node_modules/content-disposition/README.md index eebef13..992d19a 100644 --- a/node_modules/content-disposition/README.md +++ b/node_modules/content-disposition/README.md @@ -16,8 +16,6 @@ $ npm install content-disposition ## API - - ```js var contentDisposition = require('content-disposition') ``` @@ -28,8 +26,6 @@ Create an attachment `Content-Disposition` header value using the given file nam if supplied. The `filename` is optional and if no file name is desired, but you want to specify `options`, set `filename` to `undefined`. - - ```js res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf')) ``` @@ -70,10 +66,8 @@ it). The type is normalized to lower-case. ### contentDisposition.parse(string) - - ```js -var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt') +var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'); ``` Parse a `Content-Disposition` header string. This automatically handles extended @@ -94,13 +88,12 @@ are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF- ```js var contentDisposition = require('content-disposition') var destroy = require('destroy') -var fs = require('fs') var http = require('http') var onFinished = require('on-finished') var filePath = '/path/to/public/plans.pdf' -http.createServer(function onRequest (req, res) { +http.createServer(function onRequest(req, res) { // set headers res.setHeader('Content-Type', 'application/pdf') res.setHeader('Content-Disposition', contentDisposition(filePath)) @@ -108,7 +101,7 @@ http.createServer(function onRequest (req, res) { // send file var stream = fs.createReadStream(filePath) stream.pipe(res) - onFinished(res, function () { + onFinished(res, function (err) { destroy(stream) }) }) @@ -136,13 +129,13 @@ $ npm test [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/content-disposition.svg +[npm-image]: https://img.shields.io/npm/v/content-disposition.svg?style=flat [npm-url]: https://npmjs.org/package/content-disposition -[node-version-image]: https://img.shields.io/node/v/content-disposition.svg +[node-version-image]: https://img.shields.io/node/v/content-disposition.svg?style=flat [node-version-url]: https://nodejs.org/en/download -[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg +[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg?style=flat [travis-url]: https://travis-ci.org/jshttp/content-disposition -[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg?style=flat [coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master -[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg +[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg?style=flat [downloads-url]: https://npmjs.org/package/content-disposition diff --git a/node_modules/content-disposition/index.js b/node_modules/content-disposition/index.js index 3092a4d..88a0d0a 100644 --- a/node_modules/content-disposition/index.js +++ b/node_modules/content-disposition/index.js @@ -1,6 +1,6 @@ /*! * content-disposition - * Copyright(c) 2014-2017 Douglas Christopher Wilson + * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ @@ -8,7 +8,6 @@ /** * Module exports. - * @public */ module.exports = contentDisposition @@ -16,22 +15,18 @@ module.exports.parse = parse /** * Module dependencies. - * @private */ var basename = require('path').basename -var Buffer = require('safe-buffer').Buffer /** * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") - * @private */ var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex /** * RegExp to match percent encoding escape. - * @private */ var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/ @@ -39,7 +34,6 @@ var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g /** * RegExp to match non-latin1 characters. - * @private */ var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g @@ -49,14 +43,12 @@ var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g * * quoted-pair = "\" CHAR * CHAR = - * @private */ -var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex +var QESC_REGEXP = /\\([\u0000-\u007f])/g /** * RegExp to match chars that must be quoted-pair in RFC 2616 - * @private */ var QUOTE_REGEXP = /([\\"])/g @@ -83,7 +75,6 @@ var QUOTE_REGEXP = /([\\"])/g * HT = * CTL = * OCTET = - * @private */ var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex @@ -109,7 +100,6 @@ var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/ * attr-char = ALPHA / DIGIT * / "!" / "#" / "$" / "&" / "+" / "-" / "." * / "^" / "_" / "`" / "|" / "~" - * @private */ var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/ @@ -125,7 +115,6 @@ var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za- * disp-ext-parm = token "=" value * | ext-token "=" ext-value * ext-token = - * @private */ var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex @@ -138,7 +127,7 @@ var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ * @param {string} [options.type=attachment] * @param {string|boolean} [options.fallback=true] * @return {string} - * @public + * @api public */ function contentDisposition (filename, options) { @@ -160,7 +149,7 @@ function contentDisposition (filename, options) { * @param {string} [filename] * @param {string|boolean} [fallback=true] * @return {object} - * @private + * @api private */ function createparams (filename, fallback) { @@ -221,7 +210,7 @@ function createparams (filename, fallback) { * @param {string} obj.type * @param {object} [obj.parameters] * @return {string} - * @private + * @api private */ function format (obj) { @@ -259,7 +248,7 @@ function format (obj) { * * @param {string} str * @return {string} - * @private + * @api private */ function decodefield (str) { @@ -281,7 +270,7 @@ function decodefield (str) { value = getlatin1(binary) break case 'utf-8': - value = Buffer.from(binary, 'binary').toString('utf8') + value = new Buffer(binary, 'binary').toString('utf8') break default: throw new TypeError('unsupported charset in extended field') @@ -295,7 +284,7 @@ function decodefield (str) { * * @param {string} val * @return {string} - * @private + * @api private */ function getlatin1 (val) { @@ -308,7 +297,7 @@ function getlatin1 (val) { * * @param {string} string * @return {object} - * @public + * @api private */ function parse (string) { @@ -389,7 +378,7 @@ function parse (string) { * @param {string} str * @param {string} hex * @return {string} - * @private + * @api private */ function pdecode (str, hex) { @@ -401,14 +390,17 @@ function pdecode (str, hex) { * * @param {string} char * @return {string} - * @private + * @api private */ function pencode (char) { - return '%' + String(char) + var hex = String(char) .charCodeAt(0) .toString(16) .toUpperCase() + return hex.length === 1 + ? '%0' + hex + : '%' + hex } /** @@ -416,7 +408,7 @@ function pencode (char) { * * @param {string} val * @return {string} - * @private + * @api private */ function qstring (val) { @@ -430,7 +422,7 @@ function qstring (val) { * * @param {string} val * @return {string} - * @private + * @api private */ function ustring (val) { @@ -445,11 +437,6 @@ function ustring (val) { /** * Class for parsed Content-Disposition header for v8 optimization - * - * @public - * @param {string} type - * @param {object} parameters - * @constructor */ function ContentDisposition (type, parameters) { diff --git a/node_modules/content-disposition/package.json b/node_modules/content-disposition/package.json index fe52b55..dbca9d5 100644 --- a/node_modules/content-disposition/package.json +++ b/node_modules/content-disposition/package.json @@ -1,51 +1,46 @@ { - "_from": "content-disposition@0.5.3", - "_id": "content-disposition@0.5.3", + "_from": "content-disposition@0.5.2", + "_id": "content-disposition@0.5.2", "_inBundle": false, - "_integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "_integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", "_location": "/content-disposition", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "content-disposition@0.5.3", + "raw": "content-disposition@0.5.2", "name": "content-disposition", "escapedName": "content-disposition", - "rawSpec": "0.5.3", + "rawSpec": "0.5.2", "saveSpec": null, - "fetchSpec": "0.5.3" + "fetchSpec": "0.5.2" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "_shasum": "e130caf7e7279087c5616c2007d0485698984fbd", - "_spec": "content-disposition@0.5.3", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", - "author": { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, + "_resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "_shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4", + "_spec": "content-disposition@0.5.2", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "bugs": { "url": "https://github.com/jshttp/content-disposition/issues" }, "bundleDependencies": false, - "dependencies": { - "safe-buffer": "5.1.2" - }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], "deprecated": false, "description": "Create and parse Content-Disposition header", "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "5.10.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.14.0", - "eslint-plugin-markdown": "1.0.0-rc.1", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "3.11.1", + "eslint-config-standard": "6.2.1", + "eslint-plugin-promise": "3.3.0", + "eslint-plugin-standard": "2.0.1", "istanbul": "0.4.5", - "mocha": "5.2.0" + "mocha": "1.21.5" }, "engines": { "node": ">= 0.6" @@ -70,10 +65,10 @@ "url": "git+https://github.com/jshttp/content-disposition.git" }, "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", + "lint": "eslint .", "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.3" + "version": "0.5.2" } diff --git a/node_modules/express/History.md b/node_modules/express/History.md index 6e62a6d..2f6eab1 100644 --- a/node_modules/express/History.md +++ b/node_modules/express/History.md @@ -1,59 +1,3 @@ -4.17.1 / 2019-05-25 -=================== - - * Revert "Improve error message for `null`/`undefined` to `res.status`" - -4.17.0 / 2019-05-16 -=================== - - * Add `express.raw` to parse bodies into `Buffer` - * Add `express.text` to parse bodies into string - * Improve error message for non-strings to `res.sendFile` - * Improve error message for `null`/`undefined` to `res.status` - * Support multiple hosts in `X-Forwarded-Host` - * deps: accepts@~1.3.7 - * deps: body-parser@1.19.0 - - Add encoding MIK - - Add petabyte (`pb`) support - - Fix parsing array brackets after index - - deps: bytes@3.1.0 - - deps: http-errors@1.7.2 - - deps: iconv-lite@0.4.24 - - deps: qs@6.7.0 - - deps: raw-body@2.4.0 - - deps: type-is@~1.6.17 - * deps: content-disposition@0.5.3 - * deps: cookie@0.4.0 - - Add `SameSite=None` support - * deps: finalhandler@~1.1.2 - - Set stricter `Content-Security-Policy` header - - deps: parseurl@~1.3.3 - - deps: statuses@~1.5.0 - * deps: parseurl@~1.3.3 - * deps: proxy-addr@~2.0.5 - - deps: ipaddr.js@1.9.0 - * deps: qs@6.7.0 - - Fix parsing array brackets after index - * deps: range-parser@~1.2.1 - * deps: send@0.17.1 - - Set stricter CSP header in redirect & error responses - - deps: http-errors@~1.7.2 - - deps: mime@1.6.0 - - deps: ms@2.1.1 - - deps: range-parser@~1.2.1 - - deps: statuses@~1.5.0 - - perf: remove redundant `path.normalize` call - * deps: serve-static@1.14.1 - - Set stricter CSP header in redirect response - - deps: parseurl@~1.3.3 - - deps: send@0.17.1 - * deps: setprototypeof@1.1.1 - * deps: statuses@~1.5.0 - - Add `103 Early Hints` - * deps: type-is@~1.6.18 - - deps: mime-types@~2.1.24 - - perf: prevent internal `throw` on invalid type - 4.16.4 / 2018-10-10 =================== @@ -350,7 +294,7 @@ - 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 improvements + - Many performance improvments - deps: mime-types@~2.1.11 - deps: negotiator@0.6.1 * deps: content-type@~1.0.2 @@ -365,7 +309,7 @@ - perf: enable strict mode - perf: hoist regular expression - perf: use for loop in parse - - perf: use string concatenation for serialization + - 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 @@ -375,7 +319,7 @@ * deps: proxy-addr@~1.1.2 - Fix accepting various invalid netmasks - Fix IPv6-mapped IPv4 validation edge cases - - IPv4 netmasks must be contiguous + - IPv4 netmasks must be contingous - IPv6 addresses cannot be used as a netmask - deps: ipaddr.js@1.1.1 * deps: qs@6.2.0 @@ -1153,13 +1097,13 @@ - deps: negotiator@0.4.6 * deps: debug@1.0.2 * deps: send@0.4.3 - - Do not throw uncatchable error on file open race condition + - Do not throw un-catchable error on file open race condition - Use `escape-html` for HTML escaping - deps: debug@1.0.2 - deps: finished@1.2.2 - deps: fresh@0.2.2 * deps: serve-static@1.2.3 - - Do not throw uncatchable error on file open race condition + - Do not throw un-catchable error on file open race condition - deps: send@0.4.3 4.4.2 / 2014-06-09 @@ -2039,7 +1983,7 @@ - deps: serve-static@1.2.3 * deps: debug@1.0.2 * deps: send@0.4.3 - - Do not throw uncatchable error on file open race condition + - Do not throw un-catchable error on file open race condition - Use `escape-html` for HTML escaping - deps: debug@1.0.2 - deps: finished@1.2.2 @@ -3224,7 +3168,7 @@ Shaw] * Updated haml submodule * Changed ETag; removed inode, modified time only * Fixed LF to CRLF for setting multiple cookies - * Fixed cookie compilation; values are now urlencoded + * Fixed cookie complation; values are now urlencoded * Fixed cookies parsing; accepts quoted values and url escaped cookies 0.11.0 / 2010-05-06 @@ -3419,7 +3363,7 @@ Shaw] * Added "plot" format option for Profiler (for gnuplot processing) * Added request number to Profiler plugin - * Fixed binary encoding for multipart file uploads, was previously defaulting to UTF8 + * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8 * Fixed issue with routes not firing when not files are present. Closes #184 * Fixed process.Promise -> events.Promise @@ -3465,7 +3409,7 @@ Shaw] * Updated sample chat app to show messages on load * Updated libxmljs parseString -> parseHtmlString * Fixed `make init` to work with older versions of git - * Fixed specs can now run independent specs for those who can't build deps. Closes #127 + * Fixed specs can now run independent specs for those who cant build deps. Closes #127 * Fixed issues introduced by the node url module changes. Closes 126. * Fixed two assertions failing due to Collection#keys() returning strings * Fixed faulty Collection#toArray() spec due to keys() returning strings diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md index 1f91297..582e895 100644 --- a/node_modules/express/Readme.md +++ b/node_modules/express/Readme.md @@ -9,8 +9,8 @@ [![Test Coverage][coveralls-image]][coveralls-url] ```js -const express = require('express') -const app = express() +var express = require('express') +var app = express() app.get('/', function (req, res) { res.send('Hello World') @@ -90,8 +90,6 @@ $ npm install $ npm start ``` - View the website at: http://localhost:3000 - ## Philosophy The Express philosophy is to provide small, robust tooling for HTTP servers, making @@ -127,10 +125,6 @@ $ npm install $ npm test ``` -## Contributing - -[Contributing Guide](Contributing.md) - ## People The original author of Express is [TJ Holowaychuk](https://github.com/tj) @@ -153,3 +147,7 @@ The current lead maintainer is [Douglas Christopher Wilson](https://github.com/d [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express [coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master +[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg +[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/ +[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg +[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/ diff --git a/node_modules/express/lib/express.js b/node_modules/express/lib/express.js index d188a16..594007b 100644 --- a/node_modules/express/lib/express.js +++ b/node_modules/express/lib/express.js @@ -77,9 +77,7 @@ exports.Router = Router; exports.json = bodyParser.json exports.query = require('./middleware/query'); -exports.raw = bodyParser.raw exports.static = require('serve-static'); -exports.text = bodyParser.text exports.urlencoded = bodyParser.urlencoded /** diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js index a9400ef..8bb86a9 100644 --- a/node_modules/express/lib/request.js +++ b/node_modules/express/lib/request.js @@ -430,10 +430,6 @@ defineGetter(req, 'hostname', function hostname(){ if (!host || !trust(this.connection.remoteAddress, 0)) { host = this.get('Host'); - } else if (host.indexOf(',') !== -1) { - // Note: X-Forwarded-Host is normally only ever a - // single value, but this is to be safe. - host = host.substring(0, host.indexOf(',')).trimRight() } if (!host) return; diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js index c9f08cd..2e445ac 100644 --- a/node_modules/express/lib/response.js +++ b/node_modules/express/lib/response.js @@ -411,10 +411,6 @@ res.sendFile = function sendFile(path, options, callback) { throw new TypeError('path argument is required to res.sendFile'); } - if (typeof path !== 'string') { - throw new TypeError('path must be a string to res.sendFile') - } - // support function as second arg if (typeof options === 'function') { done = options; @@ -818,7 +814,7 @@ res.clearCookie = function clearCookie(name, options) { * // "Remember Me" for 15 minutes * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); * - * // same as above + * // save as above * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) * * @param {String} name @@ -1131,7 +1127,6 @@ function stringify (value, replacer, spaces, escape) { return '\\u003e' case 0x26: return '\\u0026' - /* istanbul ignore next: unreachable default */ default: return c } diff --git a/node_modules/express/node_modules/cookie/HISTORY.md b/node_modules/express/node_modules/cookie/HISTORY.md new file mode 100644 index 0000000..5bd6485 --- /dev/null +++ b/node_modules/express/node_modules/cookie/HISTORY.md @@ -0,0 +1,118 @@ +0.3.1 / 2016-05-26 +================== + + * Fix `sameSite: true` to work with draft-7 clients + - `true` now sends `SameSite=Strict` instead of `SameSite` + +0.3.0 / 2016-05-26 +================== + + * Add `sameSite` option + - Replaces `firstPartyOnly` option, never implemented by browsers + * Improve error message when `encode` is not a function + * Improve error message when `expires` is not a `Date` + +0.2.4 / 2016-05-20 +================== + + * perf: enable strict mode + * perf: use for loop in parse + * perf: use string concatination for serialization + +0.2.3 / 2015-10-25 +================== + + * Fix cookie `Max-Age` to never be a floating point number + +0.2.2 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.2.1 / 2015-09-17 +================== + + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.2.0 / 2015-08-13 +================== + + * Add `firstPartyOnly` option + * Throw better error for invalid argument to parse + * perf: hoist regular expression + +0.1.5 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.1.4 / 2015-09-17 +================== + + * Throw better error for invalid argument to parse + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.1.3 / 2015-05-19 +================== + + * Reduce the scope of try-catch deopt + * Remove argument reassignments + +0.1.2 / 2014-04-16 +================== + + * Remove unnecessary files from npm package + +0.1.1 / 2014-02-23 +================== + + * Fix bad parse when cookie value contained a comma + * Fix support for `maxAge` of `0` + +0.1.0 / 2013-05-01 +================== + + * Add `decode` option + * Add `encode` option + +0.0.6 / 2013-04-08 +================== + + * Ignore cookie parts missing `=` + +0.0.5 / 2012-10-29 +================== + + * Return raw cookie value if value unescape errors + +0.0.4 / 2012-06-21 +================== + + * Use encode/decodeURIComponent for cookie encoding/decoding + - Improve server/client interoperability + +0.0.3 / 2012-06-06 +================== + + * Only escape special characters per the cookie RFC + +0.0.2 / 2012-06-01 +================== + + * Fix `maxAge` option to not throw error + +0.0.1 / 2012-05-28 +================== + + * Add more tests + +0.0.0 / 2012-05-28 +================== + + * Initial release diff --git a/node_modules/express/node_modules/cookie/LICENSE b/node_modules/express/node_modules/cookie/LICENSE new file mode 100644 index 0000000..058b6b4 --- /dev/null +++ b/node_modules/express/node_modules/cookie/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Roman Shtylman +Copyright (c) 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 +'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/express/node_modules/cookie/README.md b/node_modules/express/node_modules/cookie/README.md new file mode 100644 index 0000000..db0d078 --- /dev/null +++ b/node_modules/express/node_modules/cookie/README.md @@ -0,0 +1,220 @@ +# cookie + +[![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] + +Basic HTTP cookie parser and serializer for HTTP servers. + +## Installation + +```sh +$ npm install cookie +``` + +## API + +```js +var cookie = require('cookie'); +``` + +### cookie.parse(str, options) + +Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs. +The `str` argument is the string representing a `Cookie` header value and `options` is an +optional object containing additional parsing options. + +```js +var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2'); +// { foo: 'bar', equation: 'E=mc^2' } +``` + +#### Options + +`cookie.parse` accepts these properties in the options object. + +##### decode + +Specifies a function that will be used to decode a cookie's value. Since the value of a cookie +has a limited character set (and must be a simple string), this function can be used to decode +a previously-encoded cookie value into a JavaScript string or other object. + +The default function is the global `decodeURIComponent`, which will decode any URL-encoded +sequences into their byte representations. + +**note** if an error is thrown from this function, the original, non-decoded cookie value will +be returned as the cookie's value. + +### cookie.serialize(name, value, options) + +Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the +name for the cookie, the `value` argument is the value to set the cookie to, and the `options` +argument is an optional object containing additional serialization options. + +```js +var setCookie = cookie.serialize('foo', 'bar'); +// foo=bar +``` + +#### Options + +`cookie.serialize` accepts these properties in the options object. + +##### domain + +Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6266-5.2.3]. By default, no +domain is set, and most clients will consider the cookie to apply to only the current domain. + +##### encode + +Specifies a function that will be used to encode a cookie's value. Since value of a cookie +has a limited character set (and must be a simple string), this function can be used to encode +a value into a string suited for a cookie's value. + +The default function is the global `ecodeURIComponent`, which will encode a JavaScript string +into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range. + +##### expires + +Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6266-5.2.1]. +By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and +will delete it on a condition like exiting a web browser application. + +**note** the [cookie storage model specification][rfc-6266-5.3] states that if both `expires` and +`magAge` are set, then `maxAge` takes precedence, but it is possiblke not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### httpOnly + +Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6266-5.2.6]. When truthy, +the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not allow client-side +JavaScript to see the cookie in `document.cookie`. + +##### maxAge + +Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6266-5.2.2]. +The given number will be converted to an integer by rounding down. By default, no maximum age is set. + +**note** the [cookie storage model specification][rfc-6266-5.3] states that if both `expires` and +`magAge` are set, then `maxAge` takes precedence, but it is possiblke not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### path + +Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6266-5.2.4]. By default, the path +is considered the ["default path"][rfc-6266-5.1.4]. By default, no maximum age is set, and most +clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting +a web browser application. + +##### sameSite + +Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][draft-west-first-party-cookies-07]. + + - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + - `false` will not set the `SameSite` attribute. + - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement. + - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + +More information about the different enforcement levels can be found in the specification +https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1.1 + +**note** This is an attribute that has not yet been fully standardized, and may change in the future. +This also means many clients may ignore this attribute until they understand it. + +##### secure + +Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6266-5.2.5]. When truthy, +the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to +the server in the future if the browser does not have an HTTPS connection. + +## Example + +The following example uses this module in conjunction with the Node.js core HTTP server +to prompt a user for their name and display it back on future visits. + +```js +var cookie = require('cookie'); +var escapeHtml = require('escape-html'); +var http = require('http'); +var url = require('url'); + +function onRequest(req, res) { + // Parse the query string + var query = url.parse(req.url, true, true).query; + + if (query && query.name) { + // Set a new cookie with the name + res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), { + httpOnly: true, + maxAge: 60 * 60 * 24 * 7 // 1 week + })); + + // Redirect back after setting cookie + res.statusCode = 302; + res.setHeader('Location', req.headers.referer || '/'); + res.end(); + return; + } + + // Parse the cookies on the request + var cookies = cookie.parse(req.headers.cookie || ''); + + // Get the visitor name set in the cookie + var name = cookies.name; + + res.setHeader('Content-Type', 'text/html; charset=UTF-8'); + + if (name) { + res.write('

Welcome back, ' + escapeHtml(name) + '!

'); + } else { + res.write('

Hello, new visitor!

'); + } + + res.write('
'); + res.write(' '); + res.end(' values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + +function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {} + var opt = options || {}; + var pairs = str.split(pairSplitRegExp); + var dec = opt.decode || decode; + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + var eq_idx = pair.indexOf('='); + + // skip things that don't look like key=value + if (eq_idx < 0) { + continue; + } + + var key = pair.substr(0, eq_idx).trim() + var val = pair.substr(++eq_idx, pair.length).trim(); + + // quoted values + if ('"' == val[0]) { + val = val.slice(1, -1); + } + + // only assign once + if (undefined == obj[key]) { + obj[key] = tryDecode(val, dec); + } + } + + return obj; +} + +/** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + +function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + if (typeof opt.expires.toUTCString !== 'function') { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + opt.expires.toUTCString(); + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; +} + +/** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + +function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } +} diff --git a/node_modules/express/node_modules/cookie/package.json b/node_modules/express/node_modules/cookie/package.json new file mode 100644 index 0000000..0f4b552 --- /dev/null +++ b/node_modules/express/node_modules/cookie/package.json @@ -0,0 +1,71 @@ +{ + "_from": "cookie@0.3.1", + "_id": "cookie@0.3.1", + "_inBundle": false, + "_integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "_location": "/express/cookie", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "cookie@0.3.1", + "name": "cookie", + "escapedName": "cookie", + "rawSpec": "0.3.1", + "saveSpec": null, + "fetchSpec": "0.3.1" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "_shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb", + "_spec": "cookie@0.3.1", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", + "author": { + "name": "Roman Shtylman", + "email": "shtylman@gmail.com" + }, + "bugs": { + "url": "https://github.com/jshttp/cookie/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "deprecated": false, + "description": "HTTP server cookie parsing and serialization", + "devDependencies": { + "istanbul": "0.4.3", + "mocha": "1.21.5" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "homepage": "https://github.com/jshttp/cookie#readme", + "keywords": [ + "cookie", + "cookies" + ], + "license": "MIT", + "name": "cookie", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/cookie.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "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": "0.3.1" +} diff --git a/node_modules/express/package.json b/node_modules/express/package.json index 71f97ae..974727d 100644 --- a/node_modules/express/package.json +++ b/node_modules/express/package.json @@ -1,28 +1,28 @@ { - "_from": "express", - "_id": "express@4.17.1", + "_from": "express@4.16.4", + "_id": "express@4.16.4", "_inBundle": false, - "_integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "_integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", "_location": "/express", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "express", + "raw": "express@4.16.4", "name": "express", "escapedName": "express", - "rawSpec": "", + "rawSpec": "4.16.4", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "4.16.4" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "_shasum": "4491fc38605cf51f8629d39c2b5d026f98a4c134", - "_spec": "express", - "_where": "C:\\Users\\Udari\\Desktop\\News", + "_resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "_shasum": "fddef61926109e24c515ea97fd2f1bdbf62df12e", + "_spec": "express@4.16.4", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -62,34 +62,34 @@ } ], "dependencies": { - "accepts": "~1.3.7", + "accepts": "~1.3.5", "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", "content-type": "~1.0.4", - "cookie": "0.4.0", + "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", - "parseurl": "~1.3.3", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", "vary": "~1.1.2" }, @@ -97,15 +97,15 @@ "description": "Fast, unopinionated, minimalist web framework", "devDependencies": { "after": "0.8.2", - "connect-redis": "3.4.1", - "cookie-parser": "~1.4.4", - "cookie-session": "1.3.3", + "connect-redis": "3.4.0", + "cookie-parser": "~1.4.3", + "cookie-session": "1.3.2", "ejs": "2.6.1", "eslint": "2.13.1", - "express-session": "1.16.1", - "hbs": "4.0.4", + "express-session": "1.15.6", + "hbs": "4.0.1", "istanbul": "0.4.5", - "marked": "0.6.2", + "marked": "0.5.1", "method-override": "3.0.0", "mocha": "5.2.0", "morgan": "1.9.1", @@ -150,5 +150,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.17.1" + "version": "4.16.4" } diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md index 920c35e..9e43d2a 100644 --- a/node_modules/finalhandler/HISTORY.md +++ b/node_modules/finalhandler/HISTORY.md @@ -1,10 +1,3 @@ -1.1.2 / 2019-05-09 -================== - - * Set stricter `Content-Security-Policy` header - * deps: parseurl@~1.3.3 - * deps: statuses@~1.5.0 - 1.1.1 / 2018-03-06 ================== diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md index 96327f0..6756f0c 100644 --- a/node_modules/finalhandler/README.md +++ b/node_modules/finalhandler/README.md @@ -116,7 +116,7 @@ var fs = require('fs') var http = require('http') var server = http.createServer(function (req, res) { - var done = finalhandler(req, res, { onerror: logerror }) + var done = finalhandler(req, res, {onerror: logerror}) fs.readFile('index.html', function (err, buf) { if (err) return done(err) diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js index 5673507..f20ffe3 100644 --- a/node_modules/finalhandler/index.js +++ b/node_modules/finalhandler/index.js @@ -282,7 +282,7 @@ function send (req, res, status, headers, message) { setHeaders(res, headers) // security headers - res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('Content-Security-Policy', "default-src 'self'") res.setHeader('X-Content-Type-Options', 'nosniff') // standard headers diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json index 16e1ee8..7ffde8d 100644 --- a/node_modules/finalhandler/package.json +++ b/node_modules/finalhandler/package.json @@ -1,27 +1,27 @@ { - "_from": "finalhandler@~1.1.2", - "_id": "finalhandler@1.1.2", + "_from": "finalhandler@1.1.1", + "_id": "finalhandler@1.1.1", "_inBundle": false, - "_integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "_integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "_location": "/finalhandler", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "finalhandler@~1.1.2", + "raw": "finalhandler@1.1.1", "name": "finalhandler", "escapedName": "finalhandler", - "rawSpec": "~1.1.2", + "rawSpec": "1.1.1", "saveSpec": null, - "fetchSpec": "~1.1.2" + "fetchSpec": "1.1.1" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "_shasum": "b7e7d000ffd11938d0fdb053506f6ebabe9f587d", - "_spec": "finalhandler@~1.1.2", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "_shasum": "eebf4ed840079c83f4249038c9d703008301b105", + "_spec": "finalhandler@1.1.1", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" @@ -35,25 +35,25 @@ "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", "unpipe": "~1.0.0" }, "deprecated": false, "description": "Node.js final http responder", "devDependencies": { - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "4.18.1", + "eslint-config-standard": "11.0.0", + "eslint-plugin-import": "2.9.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "6.0.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", - "mocha": "6.1.4", - "readable-stream": "2.3.6", - "safe-buffer": "5.1.2", - "supertest": "4.0.2" + "mocha": "2.5.3", + "readable-stream": "2.3.4", + "safe-buffer": "5.1.1", + "supertest": "1.1.0" }, "engines": { "node": ">= 0.8" @@ -76,5 +76,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.1.2" + "version": "1.1.1" } diff --git a/node_modules/http-errors/HISTORY.md b/node_modules/http-errors/HISTORY.md index efc2d4c..cba86e2 100644 --- a/node_modules/http-errors/HISTORY.md +++ b/node_modules/http-errors/HISTORY.md @@ -1,27 +1,10 @@ -2019-02-18 / 1.7.2 -================== - - * deps: setprototypeof@1.1.1 - -2018-09-08 / 1.7.1 -================== - - * Fix error creating objects in some environments - -2018-07-30 / 1.7.0 -================== - - * Set constructor name when possible - * Use `toidentifier` module to make class names - * deps: statuses@'>= 1.5.0 < 2' - 2018-03-29 / 1.6.3 ================== * deps: depd@~1.1.2 - perf: remove argument reassignment * deps: setprototypeof@1.1.0 - * deps: statuses@'>= 1.4.0 < 2' + * deps: statuses@'>= 1.3.1 < 2' 2017-08-04 / 1.6.2 ================== diff --git a/node_modules/http-errors/README.md b/node_modules/http-errors/README.md index 3b25481..79663d8 100644 --- a/node_modules/http-errors/README.md +++ b/node_modules/http-errors/README.md @@ -1,8 +1,8 @@ # http-errors -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][node-url] -[![Node.js Version][node-image]][node-url] +[![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] @@ -35,6 +35,8 @@ app.use(function (req, res, next) { This is the current API, currently extracted from Koa and subject to change. +All errors inherit from JavaScript `Error` and the exported `createError.HttpError`. + ### Error Properties - `expose` - can be used to signal if `message` should be sent to the client, @@ -50,9 +52,6 @@ This is the current API, currently extracted from Koa and subject to change. ### createError([status], [message], [properties]) -Create a new error object with the given message `msg`. -The error object inherits from `createError.HttpError`. - ```js @@ -63,36 +62,8 @@ var err = createError(404, 'This video does not exist!') - `message` - the message of the error, defaulting to node's text for that status code. - `properties` - custom properties to attach to the object -### createError([status], [error], [properties]) - -Extend the given `error` object with `createError.HttpError` -properties. This will not alter the inheritance of the given -`error` object, and the modified `error` object is the -return value. - - - -```js -fs.readFile('foo.txt', function (err, buf) { - if (err) { - if (err.code === 'ENOENT') { - var httpError = createError(404, err, { expose: false }) - } else { - var httpError = createError(500, err) - } - } -}) -``` - -- `status` - the status code as a number -- `error` - the error object to extend -- `properties` - custom properties to attach to the object - ### new createError\[code || name\](\[msg]\)) -Create a new error object with the given message `msg`. -The error object inherits from `createError.HttpError`. - ```js @@ -152,12 +123,13 @@ var err = new createError.NotFound() [MIT](LICENSE) -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master -[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master -[node-image]: https://badgen.net/npm/node/http-errors -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/http-errors +[npm-image]: https://img.shields.io/npm/v/http-errors.svg [npm-url]: https://npmjs.org/package/http-errors -[npm-version-image]: https://badgen.net/npm/v/http-errors -[travis-image]: https://badgen.net/travis/jshttp/http-errors/master +[node-version-image]: https://img.shields.io/node/v/http-errors.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg [travis-url]: https://travis-ci.org/jshttp/http-errors +[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg +[coveralls-url]: https://coveralls.io/r/jshttp/http-errors +[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg +[downloads-url]: https://npmjs.org/package/http-errors diff --git a/node_modules/http-errors/index.js b/node_modules/http-errors/index.js index 10ca4ad..9509303 100644 --- a/node_modules/http-errors/index.js +++ b/node_modules/http-errors/index.js @@ -16,7 +16,6 @@ var deprecate = require('depd')('http-errors') var setPrototypeOf = require('setprototypeof') var statuses = require('statuses') var inherits = require('inherits') -var toIdentifier = require('toidentifier') /** * Module exports. @@ -163,7 +162,6 @@ function createClientErrorConstructor (HttpError, name, code) { } inherits(ClientError, HttpError) - nameFunc(ClientError, className) ClientError.prototype.status = code ClientError.prototype.statusCode = code @@ -211,7 +209,6 @@ function createServerErrorConstructor (HttpError, name, code) { } inherits(ServerError, HttpError) - nameFunc(ServerError, className) ServerError.prototype.status = code ServerError.prototype.statusCode = code @@ -220,20 +217,6 @@ function createServerErrorConstructor (HttpError, name, code) { return ServerError } -/** - * Set the name of a function, if possible. - * @private - */ - -function nameFunc (func, name) { - var desc = Object.getOwnPropertyDescriptor(func, 'name') - - if (desc && desc.configurable) { - desc.value = name - Object.defineProperty(func, 'name', desc) - } -} - /** * Populate the exports object with constructors for every error class. * @private @@ -264,3 +247,14 @@ function populateConstructorExports (exports, codes, HttpError) { exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead') } + +/** + * Convert a string of words to a JavaScript identifier. + * @private + */ + +function toIdentifier (str) { + return str.split(' ').map(function (token) { + return token.slice(0, 1).toUpperCase() + token.slice(1) + }).join('').replace(/[^ _0-9a-z]/gi, '') +} diff --git a/node_modules/http-errors/package.json b/node_modules/http-errors/package.json index 936896f..2affa91 100644 --- a/node_modules/http-errors/package.json +++ b/node_modules/http-errors/package.json @@ -1,29 +1,29 @@ { - "_from": "http-errors@1.7.2", - "_id": "http-errors@1.7.2", + "_from": "http-errors@~1.6.3", + "_id": "http-errors@1.6.3", "_inBundle": false, - "_integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "_integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "_location": "/http-errors", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "http-errors@1.7.2", + "raw": "http-errors@~1.6.3", "name": "http-errors", "escapedName": "http-errors", - "rawSpec": "1.7.2", + "rawSpec": "~1.6.3", "saveSpec": null, - "fetchSpec": "1.7.2" + "fetchSpec": "~1.6.3" }, "_requiredBy": [ "/body-parser", "/raw-body", "/send" ], - "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "_shasum": "4f5029cf13239f31036e5b2e55292bcfbcc85c8f", - "_spec": "http-errors@1.7.2", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\body-parser", + "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "_shasum": "8b55680bb4be283a0b5bf4ea2e38580be1d9320d", + "_spec": "http-errors@~1.6.3", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\body-parser", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -46,22 +46,21 @@ "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" }, "deprecated": false, "description": "Create HTTP error objects", "devDependencies": { - "eslint": "5.13.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "4.18.1", + "eslint-config-standard": "11.0.0", + "eslint-plugin-import": "2.9.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "6.0.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", - "mocha": "5.2.0" + "mocha": "1.21.5" }, "engines": { "node": ">= 0.6" @@ -84,10 +83,10 @@ "url": "git+https://github.com/jshttp/http-errors.git" }, "scripts": { - "lint": "eslint --plugin markdown --ext js,md . && node ./scripts/lint-readme-list.js", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail", "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.7.2" + "version": "1.6.3" } diff --git a/node_modules/iconv-lite/.travis.yml b/node_modules/iconv-lite/.travis.yml new file mode 100644 index 0000000..3eab7fd --- /dev/null +++ b/node_modules/iconv-lite/.travis.yml @@ -0,0 +1,23 @@ + sudo: false + language: node_js + node_js: + - "0.10" + - "0.11" + - "0.12" + - "iojs" + - "4" + - "6" + - "8" + - "node" + + + env: + - CXX=g++-4.8 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + - g++-4.8 + diff --git a/node_modules/iconv-lite/Changelog.md b/node_modules/iconv-lite/Changelog.md index f252313..e31cd0c 100644 --- a/node_modules/iconv-lite/Changelog.md +++ b/node_modules/iconv-lite/Changelog.md @@ -1,7 +1,3 @@ -# 0.4.24 / 2018-08-22 - - * Added MIK encoding (#196, by @Ivan-Kalatchev) - # 0.4.23 / 2018-05-07 diff --git a/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/iconv-lite/encodings/sbcs-codec.js index abac5ff..f225823 100644 --- a/node_modules/iconv-lite/encodings/sbcs-codec.js +++ b/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -20,10 +20,10 @@ function SBCSCodec(codecOptions, iconv) { codecOptions.chars = asciiString + codecOptions.chars; } - this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + this.decodeBuf = new Buffer.from(codecOptions.chars, 'ucs2'); // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + var encodeBuf = new Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; diff --git a/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/iconv-lite/encodings/sbcs-data.js index fdb81a3..2d6f846 100644 --- a/node_modules/iconv-lite/encodings/sbcs-data.js +++ b/node_modules/iconv-lite/encodings/sbcs-data.js @@ -17,11 +17,6 @@ module.exports = { "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, - "mik": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", diff --git a/node_modules/iconv-lite/package.json b/node_modules/iconv-lite/package.json index 385cf27..8e85e33 100644 --- a/node_modules/iconv-lite/package.json +++ b/node_modules/iconv-lite/package.json @@ -1,28 +1,28 @@ { - "_from": "iconv-lite@0.4.24", - "_id": "iconv-lite@0.4.24", + "_from": "iconv-lite@0.4.23", + "_id": "iconv-lite@0.4.23", "_inBundle": false, - "_integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "_integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "_location": "/iconv-lite", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "iconv-lite@0.4.24", + "raw": "iconv-lite@0.4.23", "name": "iconv-lite", "escapedName": "iconv-lite", - "rawSpec": "0.4.24", + "rawSpec": "0.4.23", "saveSpec": null, - "fetchSpec": "0.4.24" + "fetchSpec": "0.4.23" }, "_requiredBy": [ "/body-parser", "/raw-body" ], - "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "_shasum": "2022b4b25fbddc21d2f524974a474aafe733908b", - "_spec": "iconv-lite@0.4.24", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\body-parser", + "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "_shasum": "297871f63be507adcfbfca715d0cd0eed84e9a63", + "_spec": "iconv-lite@0.4.23", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\body-parser", "author": { "name": "Alexander Shtuchkin", "email": "ashtuchkin@gmail.com" @@ -46,7 +46,7 @@ "iconv": "*", "istanbul": "*", "mocha": "^3.1.0", - "request": "~2.87.0", + "request": "~2.81.0", "semver": "*", "unorm": "*" }, @@ -73,5 +73,5 @@ "test": "mocha --reporter spec --grep ." }, "typings": "./lib/index.d.ts", - "version": "0.4.24" + "version": "0.4.23" } diff --git a/node_modules/mime/.npmignore b/node_modules/mime/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/mime/CHANGELOG.md b/node_modules/mime/CHANGELOG.md deleted file mode 100644 index f127535..0000000 --- a/node_modules/mime/CHANGELOG.md +++ /dev/null @@ -1,164 +0,0 @@ -# Changelog - -## v1.6.0 (24/11/2017) -*No changelog for this release.* - ---- - -## v2.0.4 (24/11/2017) -- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182) -- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181) - ---- - -## v1.5.0 (22/11/2017) -- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179) -- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178) -- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176) -- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175) -- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167) - ---- - -## v2.0.3 (25/09/2017) -*No changelog for this release.* - ---- - -## v1.4.1 (25/09/2017) -- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172) - ---- - -## v2.0.2 (15/09/2017) -- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165) -- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164) -- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163) -- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162) -- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161) -- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160) -- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152) -- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139) -- [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124) -- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113) - ---- - -## v2.0.1 (14/09/2017) -- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171) -- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170) - ---- - -## v2.0.0 (12/09/2017) -- [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168) - ---- - -## v1.4.0 (28/08/2017) -- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159) -- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158) -- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157) -- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147) -- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135) -- [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131) -- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129) -- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120) -- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118) -- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108) -- [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78) -- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74) - ---- - -## v1.3.6 (11/05/2017) -- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154) -- [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153) -- [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149) -- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141) -- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140) -- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130) -- [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126) -- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123) -- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121) -- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117) - ---- - -## v1.3.4 (06/02/2015) -*No changelog for this release.* - ---- - -## v1.3.3 (06/02/2015) -*No changelog for this release.* - ---- - -## v1.3.1 (05/02/2015) -- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111) -- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110) -- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94) -- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77) - ---- - -## v1.3.0 (05/02/2015) -- [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114) -- [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104) -- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102) -- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99) -- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98) -- [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88) -- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87) -- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86) -- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81) -- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68) - ---- - -## v1.2.11 (15/08/2013) -- [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65) -- [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63) -- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55) -- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52) - ---- - -## v1.2.10 (25/07/2013) -- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62) -- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51) - ---- - -## v1.2.9 (17/01/2013) -- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49) -- [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46) -- [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43) - ---- - -## v1.2.8 (10/01/2013) -- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47) -- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45) - ---- - -## v1.2.7 (19/10/2012) -- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41) -- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36) -- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30) -- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27) - ---- - -## v1.2.5 (16/02/2012) -- [**closed**] When looking up a types, check hasOwnProperty [#23](https://github.com/broofa/node-mime/issues/23) -- [**closed**] Bump version to 1.2.2 [#18](https://github.com/broofa/node-mime/issues/18) -- [**closed**] No license [#16](https://github.com/broofa/node-mime/issues/16) -- [**closed**] Some types missing that are used by html5/css3 [#13](https://github.com/broofa/node-mime/issues/13) -- [**closed**] npm install fails for 1.2.1 [#12](https://github.com/broofa/node-mime/issues/12) -- [**closed**] image/pjpeg + image/x-png [#10](https://github.com/broofa/node-mime/issues/10) -- [**closed**] symlink [#8](https://github.com/broofa/node-mime/issues/8) -- [**closed**] gzip [#2](https://github.com/broofa/node-mime/issues/2) -- [**closed**] ALL CAPS filenames return incorrect mime type [#1](https://github.com/broofa/node-mime/issues/1) diff --git a/node_modules/mime/build/build.js b/node_modules/mime/build/build.js new file mode 100644 index 0000000..ed5313e --- /dev/null +++ b/node_modules/mime/build/build.js @@ -0,0 +1,11 @@ +var db = require('mime-db'); + +var mapByType = {}; +Object.keys(db).forEach(function(key) { + var extensions = db[key].extensions; + if (extensions) { + mapByType[key] = extensions; + } +}); + +console.log(JSON.stringify(mapByType)); diff --git a/node_modules/mime/src/test.js b/node_modules/mime/build/test.js similarity index 97% rename from node_modules/mime/src/test.js rename to node_modules/mime/build/test.js index 42958a2..010c42b 100644 --- a/node_modules/mime/src/test.js +++ b/node_modules/mime/build/test.js @@ -41,7 +41,7 @@ assert.equal(undefined, mime.extension('unrecognized')); // Test node.types lookups // -assert.equal('font/woff', mime.lookup('file.woff')); +assert.equal('application/font-woff', mime.lookup('file.woff')); assert.equal('application/octet-stream', mime.lookup('file.buffer')); // TODO: Uncomment once #157 is resolved // assert.equal('audio/mp4', mime.lookup('file.m4a')); diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json index 7714af3..b33e11c 100644 --- a/node_modules/mime/package.json +++ b/node_modules/mime/package.json @@ -1,27 +1,27 @@ { - "_from": "mime@1.6.0", - "_id": "mime@1.6.0", + "_from": "mime@1.4.1", + "_id": "mime@1.4.1", "_inBundle": false, - "_integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "_integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", "_location": "/mime", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "mime@1.6.0", + "raw": "mime@1.4.1", "name": "mime", "escapedName": "mime", - "rawSpec": "1.6.0", + "rawSpec": "1.4.1", "saveSpec": null, - "fetchSpec": "1.6.0" + "fetchSpec": "1.4.1" }, "_requiredBy": [ "/send" ], - "_resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "_shasum": "32cd9e5c64553bd58d19a568af452acff04981b1", - "_spec": "mime@1.6.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\send", + "_resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "_shasum": "121f9ebc49e3766f311a76e1fa1c8003c4b03aa6", + "_spec": "mime@1.4.1", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\send", "author": { "name": "Robert Kieffer", "email": "robert@broofa.com", @@ -45,12 +45,7 @@ "deprecated": false, "description": "A comprehensive library for mime-type mapping", "devDependencies": { - "github-release-notes": "0.13.1", - "mime-db": "1.31.0", - "mime-score": "1.1.0" - }, - "engines": { - "node": ">=4" + "mime-db": "1.30.0" }, "homepage": "https://github.com/broofa/node-mime#readme", "keywords": [ @@ -65,9 +60,8 @@ "type": "git" }, "scripts": { - "changelog": "gren changelog --tags=all --generate --override", - "prepare": "node src/build.js", - "test": "node src/test.js" + "prepublish": "node build/build.js > types.json", + "test": "node build/test.js" }, - "version": "1.6.0" + "version": "1.4.1" } diff --git a/node_modules/mime/src/build.js b/node_modules/mime/src/build.js deleted file mode 100644 index 4928e48..0000000 --- a/node_modules/mime/src/build.js +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const mimeScore = require('mime-score'); - -let db = require('mime-db'); -let chalk = require('chalk'); - -const STANDARD_FACET_SCORE = 900; - -const byExtension = {}; - -// Clear out any conflict extensions in mime-db -for (let type in db) { - let entry = db[type]; - entry.type = type; - - if (!entry.extensions) continue; - - entry.extensions.forEach(ext => { - if (ext in byExtension) { - const e0 = entry; - const e1 = byExtension[ext]; - e0.pri = mimeScore(e0.type, e0.source); - e1.pri = mimeScore(e1.type, e1.source); - - let drop = e0.pri < e1.pri ? e0 : e1; - let keep = e0.pri >= e1.pri ? e0 : e1; - drop.extensions = drop.extensions.filter(e => e !== ext); - - console.log(`${ext}: Keeping ${chalk.green(keep.type)} (${keep.pri}), dropping ${chalk.red(drop.type)} (${drop.pri})`); - } - byExtension[ext] = entry; - }); -} - -function writeTypesFile(types, path) { - fs.writeFileSync(path, JSON.stringify(types)); -} - -// Segregate into standard and non-standard types based on facet per -// https://tools.ietf.org/html/rfc6838#section-3.1 -const types = {}; - -Object.keys(db).sort().forEach(k => { - const entry = db[k]; - types[entry.type] = entry.extensions; -}); - -writeTypesFile(types, path.join(__dirname, '..', 'types.json')); diff --git a/node_modules/mime/types.json b/node_modules/mime/types.json index bec78ab..5369cd1 100644 --- a/node_modules/mime/types.json +++ b/node_modules/mime/types.json @@ -1 +1 @@ -{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} \ No newline at end of file +{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["exe"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":["mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":["wav"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["ra"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["bmp"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":["rtf"],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":["xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} diff --git a/node_modules/qs/.editorconfig b/node_modules/qs/.editorconfig index a4893dd..b2654e7 100644 --- a/node_modules/qs/.editorconfig +++ b/node_modules/qs/.editorconfig @@ -7,7 +7,7 @@ end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -max_line_length = 160 +max_line_length = 140 [test/*] max_line_length = off diff --git a/node_modules/qs/.eslintrc b/node_modules/qs/.eslintrc index e3bde89..b7a87b9 100644 --- a/node_modules/qs/.eslintrc +++ b/node_modules/qs/.eslintrc @@ -9,10 +9,8 @@ "func-name-matching": 0, "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], "indent": [2, 4], - "max-lines-per-function": [2, { "max": 150 }], - "max-params": [2, 14], - "max-statements": [2, 52], - "multiline-comment-style": 0, + "max-params": [2, 12], + "max-statements": [2, 45], "no-continue": 1, "no-magic-numbers": 0, "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], diff --git a/node_modules/qs/CHANGELOG.md b/node_modules/qs/CHANGELOG.md index 50505c4..fe52320 100644 --- a/node_modules/qs/CHANGELOG.md +++ b/node_modules/qs/CHANGELOG.md @@ -1,33 +1,3 @@ -## **6.7.0** -- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) -- [Fix] correctly parse nested arrays (#212) -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source -- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` -- [Refactor] `utils`: `isBuffer`: small tweak; add tests -- [Refactor] use cached `Array.isArray` -- [Refactor] `parse`/`stringify`: make a function to normalize the options -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] `stringify`/`utils`: cache `Array.isArray` -- [Tests] always use `String(x)` over `x.toString()` -- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 -- [Tests] temporarily allow coverage to fail - -## **6.6.0** -- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) -- [New] move two-value combine to a `utils` function (#189) -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) -- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Refactor] `parse`: only need to reassign the var once -- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults -- [Refactor] add missing defaults -- [Refactor] `parse`: one less `concat` call -- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` -- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS - ## **6.5.2** - [Fix] use `safer-buffer` instead of `Buffer` constructor - [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) diff --git a/node_modules/qs/README.md b/node_modules/qs/README.md index 8590cfd..d811966 100644 --- a/node_modules/qs/README.md +++ b/node_modules/qs/README.md @@ -146,62 +146,6 @@ var withDots = qs.parse('a.b=c', { allowDots: true }); assert.deepEqual(withDots, { a: { b: 'c' } }); ``` -If you have to deal with legacy browsers or services, there's -also support for decoding percent-encoded octets as iso-8859-1: - -```javascript -var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); -assert.deepEqual(oldCharset, { a: '§' }); -``` - -Some services add an initial `utf8=✓` value to forms so that old -Internet Explorer versions are more likely to submit the form as -utf-8. Additionally, the server can check the value against wrong -encodings of the checkmark character and detect that a query string -or `application/x-www-form-urlencoded` body was *not* sent as -utf-8, eg. if the form had an `accept-charset` parameter or the -containing page had a different character set. - -**qs** supports this mechanism via the `charsetSentinel` option. -If specified, the `utf8` parameter will be omitted from the -returned object. It will be used to switch to `iso-8859-1`/`utf-8` -mode depending on how the checkmark is encoded. - -**Important**: When you specify both the `charset` option and the -`charsetSentinel` option, the `charset` will be overridden when -the request contains a `utf8` parameter from which the actual -charset can be deduced. In that sense the `charset` will behave -as the default charset rather than the authoritative charset. - -```javascript -var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { - charset: 'iso-8859-1', - charsetSentinel: true -}); -assert.deepEqual(detectedAsUtf8, { a: 'ø' }); - -// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: -var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { - charset: 'utf-8', - charsetSentinel: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); -``` - -If you want to decode the `&#...;` syntax to the actual character, -you can specify the `interpretNumericEntities` option as well: - -```javascript -var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { - charset: 'iso-8859-1', - interpretNumericEntities: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); -``` - -It also works when the charset has been detected in `charsetSentinel` -mode. - ### Parsing Arrays **qs** can also parse arrays using a similar `[]` notation: @@ -238,7 +182,7 @@ assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); ``` **qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will -instead be converted to an object with the index as the key. This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. +instead be converted to an object with the index as the key: ```javascript var withMaxIndex = qs.parse('a[100]=b'); @@ -273,13 +217,6 @@ var arraysOfObjects = qs.parse('a[][b]=c'); assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); ``` -Some people use comma to join array, **qs** can parse it: -```javascript -var arraysOfObjects = qs.parse('a=b,c', { comma: true }) -assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) -``` -(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) - ### Stringifying [](#preventEval) @@ -355,8 +292,6 @@ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) // 'a[]=b&a[]=c' qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) // 'a=b&a=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) -// 'a=b,c' ``` When objects are stringified, by default they use bracket notation: @@ -491,40 +426,10 @@ var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); assert.equal(nullsSkipped, 'a=b'); ``` -If you're communicating with legacy systems, you can switch to `iso-8859-1` -using the `charset` option: - -```javascript -var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); -assert.equal(iso, '%E6=%E6'); -``` - -Characters that don't exist in `iso-8859-1` will be converted to numeric -entities, similar to what browsers do: - -```javascript -var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); -assert.equal(numeric, 'a=%26%239786%3B'); -``` - -You can use the `charsetSentinel` option to announce the character by -including an `utf8=✓` parameter with the proper encoding if the checkmark, -similar to what Ruby on Rails and others do when submitting forms. - -```javascript -var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); -assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); - -var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); -assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); -``` - ### Dealing with special character sets -By default the encoding and decoding of characters is done in `utf-8`, -and `iso-8859-1` support is also built in via the `charset` parameter. - -If you wish to encode querystrings to a different character set (i.e. +By default the encoding and decoding of characters is done in `utf-8`. If you +wish to encode querystrings to a different character set (i.e. [Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the [`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: diff --git a/node_modules/qs/dist/qs.js b/node_modules/qs/dist/qs.js index 17f4e60..ecf7ba4 100644 --- a/node_modules/qs/dist/qs.js +++ b/node_modules/qs/dist/qs.js @@ -42,63 +42,21 @@ var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, - charset: 'utf-8', - charsetSentinel: false, - comma: false, decoder: utils.decode, delimiter: '&', depth: 5, - ignoreQueryPrefix: false, - interpretNumericEntities: false, parameterLimit: 1000, - parseArrays: true, plainObjects: false, strictNullHandling: false }; -var interpretNumericEntities = function (str) { - return str.replace(/&#(\d+);/g, function ($0, numberStr) { - return String.fromCharCode(parseInt(numberStr, 10)); - }); -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } + for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); @@ -106,23 +64,14 @@ var parseValues = function parseQueryStringValues(str, options) { var key, val; if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset); + key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset); - val = options.decoder(part.slice(pos + 1), defaults.decoder, charset); - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); - } - - if (val && options.comma && val.indexOf(',') > -1) { - val = val.split(','); + key = options.decoder(part.slice(0, pos), defaults.decoder); + val = options.decoder(part.slice(pos + 1), defaults.decoder); } - if (has.call(obj, key)) { - obj[key] = utils.combine(obj[key], val); + obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } @@ -138,15 +87,14 @@ var parseObject = function (chain, val, options) { var obj; var root = chain[i]; - if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); + if (root === '[]') { + obj = []; + obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { - obj = { 0: leaf }; - } else if ( + if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot @@ -188,7 +136,8 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { var keys = []; if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; @@ -220,41 +169,24 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { return parseObject(keys, val, options); }; -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } +module.exports = function (str, opts) { + var options = opts ? utils.assign({}, opts) : {}; - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); + options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; + options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; @@ -280,13 +212,11 @@ module.exports = function (str, opts) { var utils = require('./utils'); var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, - comma: 'comma', indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, @@ -295,26 +225,13 @@ var arrayPrefixGenerators = { } }; -var isArray = Array.isArray; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - var toISO = Date.prototype.toISOString; var defaults = { - addQueryPrefix: false, - allowDots: false, - charset: 'utf-8', - charsetSentinel: false, delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, - formatter: formats.formatters[formats['default']], - // deprecated - indices: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, @@ -334,21 +251,16 @@ var stringify = function stringify( // eslint-disable-line func-name-matching allowDots, serializeDate, formatter, - encodeValuesOnly, - charset + encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = obj.join(','); - } - - if (obj === null) { + } else if (obj === null) { if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix; + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; @@ -356,8 +268,8 @@ var stringify = function stringify( // eslint-disable-line func-name-matching if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset))]; + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } @@ -369,7 +281,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching } var objKeys; - if (isArray(filter)) { + if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); @@ -383,10 +295,10 @@ var stringify = function stringify( // eslint-disable-line func-name-matching continue; } - if (isArray(obj)) { - pushToArray(values, stringify( + if (Array.isArray(obj)) { + values = values.concat(stringify( obj[key], - typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix, + generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, @@ -396,11 +308,10 @@ var stringify = function stringify( // eslint-disable-line func-name-matching allowDots, serializeDate, formatter, - encodeValuesOnly, - charset + encodeValuesOnly )); } else { - pushToArray(values, stringify( + values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, @@ -412,8 +323,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching allowDots, serializeDate, formatter, - encodeValuesOnly, - charset + encodeValuesOnly )); } } @@ -421,63 +331,36 @@ var stringify = function stringify( // eslint-disable-line func-name-matching return values; }; -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } +module.exports = function (object, opts) { + var obj = object; + var options = opts ? utils.assign({}, opts) : {}; - if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; + var sort = typeof options.sort === 'function' ? options.sort : null; + var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; + var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; + var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; + if (typeof options.format === 'undefined') { + options.format = formats['default']; + } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { + throw new TypeError('Unknown format option provided.'); + } + var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); - } else if (isArray(options.filter)) { + } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } @@ -489,10 +372,10 @@ module.exports = function (object, opts) { } var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } @@ -503,46 +386,36 @@ module.exports = function (object, opts) { objKeys = Object.keys(obj); } - if (options.sort) { - objKeys.sort(options.sort); + if (sort) { + objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; - if (options.skipNulls && obj[key] === null) { + if (skipNulls && obj[key] === null) { continue; } - pushToArray(keys, stringify( + + keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, - options.strictNullHandling, - options.skipNulls, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.formatter, - options.encodeValuesOnly, - options.charset + strictNullHandling, + skipNulls, + encode ? encoder : null, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly )); } - var joined = keys.join(options.delimiter); + var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - return joined.length > 0 ? prefix + joined : ''; }; @@ -550,7 +423,6 @@ module.exports = function (object, opts) { 'use strict'; var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; var hexTable = (function () { var array = []; @@ -562,11 +434,13 @@ var hexTable = (function () { }()); var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { + var obj; + + while (queue.length) { var item = queue.pop(); - var obj = item.obj[item.prop]; + obj = item.obj[item.prop]; - if (isArray(obj)) { + if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { @@ -578,6 +452,8 @@ var compactQueue = function compactQueue(queue) { item.obj[item.prop] = compacted; } } + + return obj; }; var arrayToObject = function arrayToObject(source, options) { @@ -597,10 +473,10 @@ var merge = function merge(target, source, options) { } if (typeof source !== 'object') { - if (isArray(target)) { + if (Array.isArray(target)) { target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { + } else if (typeof target === 'object') { + if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { @@ -610,21 +486,20 @@ var merge = function merge(target, source, options) { return target; } - if (!target || typeof target !== 'object') { + if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; - if (isArray(target) && !isArray(source)) { + if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = arrayToObject(target, options); } - if (isArray(target) && isArray(source)) { + if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); + if (target[i] && typeof target[i] === 'object') { + target[i] = merge(target[i], item, options); } else { target.push(item); } @@ -654,21 +529,15 @@ var assign = function assignSingleSource(target, source) { }, target); }; -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 +var decode = function (str) { try { - return decodeURIComponent(strWithoutPlus); + return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { - return strWithoutPlus; + return str; } }; -var encode = function encode(str, defaultEncoder, charset) { +var encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { @@ -677,12 +546,6 @@ var encode = function encode(str, defaultEncoder, charset) { var string = typeof str === 'string' ? str : String(str); - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); @@ -745,9 +608,7 @@ var compact = function compact(value) { } } - compactQueue(queue); - - return value; + return compactQueue(queue); }; var isRegExp = function isRegExp(obj) { @@ -755,21 +616,16 @@ var isRegExp = function isRegExp(obj) { }; var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { + if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; -var combine = function combine(a, b) { - return [].concat(a, b); -}; - module.exports = { arrayToObject: arrayToObject, assign: assign, - combine: combine, compact: compact, decode: decode, encode: encode, diff --git a/node_modules/qs/lib/parse.js b/node_modules/qs/lib/parse.js index d81628b..8c9872e 100644 --- a/node_modules/qs/lib/parse.js +++ b/node_modules/qs/lib/parse.js @@ -8,63 +8,21 @@ var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, - charset: 'utf-8', - charsetSentinel: false, - comma: false, decoder: utils.decode, delimiter: '&', depth: 5, - ignoreQueryPrefix: false, - interpretNumericEntities: false, parameterLimit: 1000, - parseArrays: true, plainObjects: false, strictNullHandling: false }; -var interpretNumericEntities = function (str) { - return str.replace(/&#(\d+);/g, function ($0, numberStr) { - return String.fromCharCode(parseInt(numberStr, 10)); - }); -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } + for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); @@ -72,23 +30,14 @@ var parseValues = function parseQueryStringValues(str, options) { var key, val; if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset); + key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset); - val = options.decoder(part.slice(pos + 1), defaults.decoder, charset); - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); + key = options.decoder(part.slice(0, pos), defaults.decoder); + val = options.decoder(part.slice(pos + 1), defaults.decoder); } - - if (val && options.comma && val.indexOf(',') > -1) { - val = val.split(','); - } - if (has.call(obj, key)) { - obj[key] = utils.combine(obj[key], val); + obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } @@ -104,15 +53,14 @@ var parseObject = function (chain, val, options) { var obj; var root = chain[i]; - if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); + if (root === '[]') { + obj = []; + obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { - obj = { 0: leaf }; - } else if ( + if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot @@ -154,7 +102,8 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { var keys = []; if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; @@ -186,41 +135,24 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { return parseObject(keys, val, options); }; -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } +module.exports = function (str, opts) { + var options = opts ? utils.assign({}, opts) : {}; - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); + options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; + options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; diff --git a/node_modules/qs/lib/stringify.js b/node_modules/qs/lib/stringify.js index 7455049..ab915ac 100644 --- a/node_modules/qs/lib/stringify.js +++ b/node_modules/qs/lib/stringify.js @@ -2,13 +2,11 @@ var utils = require('./utils'); var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, - comma: 'comma', indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, @@ -17,26 +15,13 @@ var arrayPrefixGenerators = { } }; -var isArray = Array.isArray; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - var toISO = Date.prototype.toISOString; var defaults = { - addQueryPrefix: false, - allowDots: false, - charset: 'utf-8', - charsetSentinel: false, delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, - formatter: formats.formatters[formats['default']], - // deprecated - indices: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, @@ -56,21 +41,16 @@ var stringify = function stringify( // eslint-disable-line func-name-matching allowDots, serializeDate, formatter, - encodeValuesOnly, - charset + encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = obj.join(','); - } - - if (obj === null) { + } else if (obj === null) { if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix; + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; @@ -78,8 +58,8 @@ var stringify = function stringify( // eslint-disable-line func-name-matching if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset))]; + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } @@ -91,7 +71,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching } var objKeys; - if (isArray(filter)) { + if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); @@ -105,10 +85,10 @@ var stringify = function stringify( // eslint-disable-line func-name-matching continue; } - if (isArray(obj)) { - pushToArray(values, stringify( + if (Array.isArray(obj)) { + values = values.concat(stringify( obj[key], - typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix, + generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, @@ -118,11 +98,10 @@ var stringify = function stringify( // eslint-disable-line func-name-matching allowDots, serializeDate, formatter, - encodeValuesOnly, - charset + encodeValuesOnly )); } else { - pushToArray(values, stringify( + values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, @@ -134,8 +113,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching allowDots, serializeDate, formatter, - encodeValuesOnly, - charset + encodeValuesOnly )); } } @@ -143,63 +121,36 @@ var stringify = function stringify( // eslint-disable-line func-name-matching return values; }; -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } +module.exports = function (object, opts) { + var obj = object; + var options = opts ? utils.assign({}, opts) : {}; - if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; + var sort = typeof options.sort === 'function' ? options.sort : null; + var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; + var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; + var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; + if (typeof options.format === 'undefined') { + options.format = formats['default']; + } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { + throw new TypeError('Unknown format option provided.'); + } + var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); - } else if (isArray(options.filter)) { + } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } @@ -211,10 +162,10 @@ module.exports = function (object, opts) { } var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } @@ -225,45 +176,35 @@ module.exports = function (object, opts) { objKeys = Object.keys(obj); } - if (options.sort) { - objKeys.sort(options.sort); + if (sort) { + objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; - if (options.skipNulls && obj[key] === null) { + if (skipNulls && obj[key] === null) { continue; } - pushToArray(keys, stringify( + + keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, - options.strictNullHandling, - options.skipNulls, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.formatter, - options.encodeValuesOnly, - options.charset + strictNullHandling, + skipNulls, + encode ? encoder : null, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly )); } - var joined = keys.join(options.delimiter); + var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - return joined.length > 0 ? prefix + joined : ''; }; diff --git a/node_modules/qs/lib/utils.js b/node_modules/qs/lib/utils.js index 1b219cd..8775a32 100644 --- a/node_modules/qs/lib/utils.js +++ b/node_modules/qs/lib/utils.js @@ -1,7 +1,6 @@ 'use strict'; var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; var hexTable = (function () { var array = []; @@ -13,11 +12,13 @@ var hexTable = (function () { }()); var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { + var obj; + + while (queue.length) { var item = queue.pop(); - var obj = item.obj[item.prop]; + obj = item.obj[item.prop]; - if (isArray(obj)) { + if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { @@ -29,6 +30,8 @@ var compactQueue = function compactQueue(queue) { item.obj[item.prop] = compacted; } } + + return obj; }; var arrayToObject = function arrayToObject(source, options) { @@ -48,10 +51,10 @@ var merge = function merge(target, source, options) { } if (typeof source !== 'object') { - if (isArray(target)) { + if (Array.isArray(target)) { target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { + } else if (typeof target === 'object') { + if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { @@ -61,21 +64,20 @@ var merge = function merge(target, source, options) { return target; } - if (!target || typeof target !== 'object') { + if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; - if (isArray(target) && !isArray(source)) { + if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = arrayToObject(target, options); } - if (isArray(target) && isArray(source)) { + if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); + if (target[i] && typeof target[i] === 'object') { + target[i] = merge(target[i], item, options); } else { target.push(item); } @@ -105,21 +107,15 @@ var assign = function assignSingleSource(target, source) { }, target); }; -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 +var decode = function (str) { try { - return decodeURIComponent(strWithoutPlus); + return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { - return strWithoutPlus; + return str; } }; -var encode = function encode(str, defaultEncoder, charset) { +var encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { @@ -128,12 +124,6 @@ var encode = function encode(str, defaultEncoder, charset) { var string = typeof str === 'string' ? str : String(str); - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); @@ -196,9 +186,7 @@ var compact = function compact(value) { } } - compactQueue(queue); - - return value; + return compactQueue(queue); }; var isRegExp = function isRegExp(obj) { @@ -206,21 +194,16 @@ var isRegExp = function isRegExp(obj) { }; var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { + if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; -var combine = function combine(a, b) { - return [].concat(a, b); -}; - module.exports = { arrayToObject: arrayToObject, assign: assign, - combine: combine, compact: compact, decode: decode, encode: encode, diff --git a/node_modules/qs/package.json b/node_modules/qs/package.json index b818d7f..5e9ed0f 100644 --- a/node_modules/qs/package.json +++ b/node_modules/qs/package.json @@ -1,28 +1,28 @@ { - "_from": "qs@6.7.0", - "_id": "qs@6.7.0", + "_from": "qs@6.5.2", + "_id": "qs@6.5.2", "_inBundle": false, - "_integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "_integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "_location": "/qs", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "qs@6.7.0", + "raw": "qs@6.5.2", "name": "qs", "escapedName": "qs", - "rawSpec": "6.7.0", + "rawSpec": "6.5.2", "saveSpec": null, - "fetchSpec": "6.7.0" + "fetchSpec": "6.5.2" }, "_requiredBy": [ "/body-parser", "/express" ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "_shasum": "41dc1a015e3d581f1621776be31afb2876a9b1bc", - "_spec": "qs@6.7.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "_shasum": "cb3ae806e8740444584ef154ce8ee98d403f3e36", + "_spec": "qs@6.5.2", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "bugs": { "url": "https://github.com/ljharb/qs/issues" }, @@ -38,20 +38,18 @@ "deprecated": false, "description": "A querystring parser that supports nesting and arrays, with a depth limit", "devDependencies": { - "@ljharb/eslint-config": "^13.1.1", - "browserify": "^16.2.3", - "covert": "^1.1.1", + "@ljharb/eslint-config": "^12.2.1", + "browserify": "^16.2.0", + "covert": "^1.1.0", "editorconfig-tools": "^0.1.1", - "eslint": "^5.15.3", + "eslint": "^4.19.1", "evalmd": "^0.0.17", - "for-each": "^0.3.3", - "iconv-lite": "^0.4.24", + "iconv-lite": "^0.4.21", "mkdirp": "^0.5.1", - "object-inspect": "^1.6.0", "qs-iconv": "^1.0.4", - "safe-publish-latest": "^1.1.2", + "safe-publish-latest": "^1.1.1", "safer-buffer": "^2.1.2", - "tape": "^4.10.1" + "tape": "^4.9.0" }, "engines": { "node": ">=0.6" @@ -59,11 +57,7 @@ "homepage": "https://github.com/ljharb/qs", "keywords": [ "querystring", - "qs", - "query", - "url", - "parse", - "stringify" + "qs" ], "license": "BSD-3-Clause", "main": "lib/index.js", @@ -76,12 +70,12 @@ "coverage": "covert test", "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", "lint": "eslint lib/*.js test/*.js", - "postlint": "editorconfig-tools check * lib/* test/*", + "prelint": "editorconfig-tools check * lib/* test/*", "prepublish": "safe-publish-latest && npm run dist", "pretest": "npm run --silent readme && npm run --silent lint", "readme": "evalmd README.md", "test": "npm run --silent coverage", "tests-only": "node test" }, - "version": "6.7.0" + "version": "6.5.2" } diff --git a/node_modules/qs/test/.eslintrc b/node_modules/qs/test/.eslintrc index 9ebbb92..20175d6 100644 --- a/node_modules/qs/test/.eslintrc +++ b/node_modules/qs/test/.eslintrc @@ -3,9 +3,7 @@ "array-bracket-newline": 0, "array-element-newline": 0, "consistent-return": 2, - "function-paren-newline": 0, "max-lines": 0, - "max-lines-per-function": 0, "max-nested-callbacks": [2, 3], "max-statements": 0, "no-buffer-constructor": 0, diff --git a/node_modules/qs/test/parse.js b/node_modules/qs/test/parse.js index 8967789..0f8fe45 100644 --- a/node_modules/qs/test/parse.js +++ b/node_modules/qs/test/parse.js @@ -237,14 +237,6 @@ test('parse()', function (t) { st.end(); }); - t.test('parses jquery-param strings', function (st) { - // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' - var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; - var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; - st.deepEqual(qs.parse(encoded), expected); - st.end(); - }); - t.test('continues parsing when no parent is found', function (st) { st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); @@ -265,7 +257,7 @@ test('parse()', function (t) { st.end(); }); - t.test('should not throw when a native prototype has an enumerable property', function (st) { + t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) { Object.prototype.crash = ''; Array.prototype.crash = ''; st.doesNotThrow(qs.parse.bind(null, 'a=b')); @@ -310,14 +302,7 @@ test('parse()', function (t) { }); t.test('allows disabling array parsing', function (st) { - var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); - st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); - st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); - - var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); - st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); - st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); - + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { 0: 'b', 1: 'c' } }); st.end(); }); @@ -347,15 +332,6 @@ test('parse()', function (t) { st.end(); }); - t.test('parses string with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); - st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); - st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); - st.end(); - }); - t.test('parses an object in dot notation', function (st) { var input = { 'user.name': { 'pop[bob]': 3 }, @@ -564,7 +540,7 @@ test('parse()', function (t) { result.push(parseInt(parts[1], 16)); parts = reg.exec(str); } - return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); + return iconv.decode(SaferBuffer.from(result), 'shift_jis').toString(); } }), { 県: '大阪府' }); st.end(); @@ -594,83 +570,5 @@ test('parse()', function (t) { st.end(); }); - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.parse('a=b', { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('parses an iso-8859-1 string if asked to', function (st) { - st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); - st.end(); - }); - - var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; - var urlEncodedOSlashInUtf8 = '%C3%B8'; - var urlEncodedNumCheckmark = '%26%2310003%3B'; - var urlEncodedNumSmiley = '%26%239786%3B'; - - t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); - st.end(); - }); - - t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { - st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); - st.end(); - }); - - t.test('should ignore an utf8 sentinel with an unknown value', function (st) { - st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { - charset: 'iso-8859-1', - decoder: function (str, defaultDecoder, charset) { - return str ? defaultDecoder(str, defaultDecoder, charset) : null; - }, - interpretNumericEntities: true - }), { foo: null, bar: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { - st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); - st.end(); - }); - t.end(); }); diff --git a/node_modules/qs/test/stringify.js b/node_modules/qs/test/stringify.js index 53041c2..165ac62 100644 --- a/node_modules/qs/test/stringify.js +++ b/node_modules/qs/test/stringify.js @@ -19,15 +19,6 @@ test('stringify()', function (t) { st.end(); }); - t.test('stringifies falsy values', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(null, { strictNullHandling: true }), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(0), ''); - st.end(); - }); - t.test('adds query prefix', function (st) { st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); st.end(); @@ -38,13 +29,6 @@ test('stringify()', function (t) { st.end(); }); - t.test('stringifies nested falsy values', function (st) { - st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); - st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); - st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); - st.end(); - }); - t.test('stringifies a nested object', function (st) { st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); @@ -68,11 +52,6 @@ test('stringify()', function (t) { 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', 'brackets => brackets' ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), - 'a=b%2Cc%2Cd', - 'comma => comma' - ); st.equal( qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', @@ -99,7 +78,6 @@ test('stringify()', function (t) { t.test('stringifies a nested array value', function (st) { st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'comma' }), 'a%5Bb%5D=c%2Cd'); // a[b]=c,d st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); st.end(); }); @@ -121,14 +99,6 @@ test('stringify()', function (t) { 'a.b[]=c&a.b[]=d', 'brackets: stringifies with dots + brackets' ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encode: false, arrayFormat: 'comma' } - ), - 'a.b=c,d', - 'comma: stringifies with dots + comma' - ); st.equal( qs.stringify( { a: { b: ['c', 'd'] } }, @@ -143,12 +113,12 @@ test('stringify()', function (t) { t.test('stringifies an object inside an array', function (st) { st.equal( qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }), - 'a%5B0%5D%5Bb%5D=c', // a[0][b]=c + 'a%5B0%5D%5Bb%5D=c', 'indices => brackets' ); st.equal( qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }), - 'a%5B%5D%5Bb%5D=c', // a[][b]=c + 'a%5B%5D%5Bb%5D=c', 'brackets => brackets' ); st.equal( @@ -616,38 +586,6 @@ test('stringify()', function (t) { st.end(); }); - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.stringify({ a: 'b' }, { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('respects a charset of iso-8859-1', function (st) { - st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); - st.end(); - }); - - t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { - st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); - st.end(); - }); - - t.test('respects an explicit charset of utf-8 (the default)', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); - st.end(); - }); - - t.test('adds the right sentinel when instructed to and the charset is utf-8', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), 'utf8=%E2%9C%93&a=%C3%A6'); - st.end(); - }); - - t.test('adds the right sentinel when instructed to and the charset is iso-8859-1', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), 'utf8=%26%2310003%3B&a=%E6'); - st.end(); - }); - t.test('does not mutate the options argument', function (st) { var options = {}; qs.stringify({}, options); @@ -655,25 +593,5 @@ test('stringify()', function (t) { st.end(); }); - t.test('strictNullHandling works with custom filter', function (st) { - var filter = function (prefix, value) { - return value; - }; - - var options = { strictNullHandling: true, filter: filter }; - st.equal(qs.stringify({ key: null }, options), 'key'); - st.end(); - }); - - t.test('strictNullHandling works with null serializeDate', function (st) { - var serializeDate = function () { - return null; - }; - var options = { strictNullHandling: true, serializeDate: serializeDate }; - var date = new Date(); - st.equal(qs.stringify({ key: date }, options), 'key'); - st.end(); - }); - t.end(); }); diff --git a/node_modules/qs/test/utils.js b/node_modules/qs/test/utils.js index da31ce5..eff4011 100644 --- a/node_modules/qs/test/utils.js +++ b/node_modules/qs/test/utils.js @@ -1,16 +1,9 @@ 'use strict'; var test = require('tape'); -var inspect = require('object-inspect'); -var SaferBuffer = require('safer-buffer').Buffer; -var forEach = require('for-each'); var utils = require('../lib/utils'); test('merge()', function (t) { - t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); - - t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); - t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); @@ -25,33 +18,6 @@ test('merge()', function (t) { var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); - t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); - - t.test( - 'avoids invoking array setters unnecessarily', - { skip: typeof Object.defineProperty !== 'function' }, - function (st) { - var setCount = 0; - var getCount = 0; - var observed = []; - Object.defineProperty(observed, 0, { - get: function () { - getCount += 1; - return { bar: 'baz' }; - }, - set: function () { setCount += 1; } - }); - utils.merge(observed, [null]); - st.equal(setCount, 0); - st.equal(getCount, 1); - observed[0] = observed[0]; // eslint-disable-line no-self-assign - st.equal(setCount, 1); - st.equal(getCount, 2); - st.end(); - } - ); - t.end(); }); @@ -66,71 +32,3 @@ test('assign()', function (t) { t.end(); }); - -test('combine()', function (t) { - t.test('both arrays', function (st) { - var a = [1]; - var b = [2]; - var combined = utils.combine(a, b); - - st.deepEqual(a, [1], 'a is not mutated'); - st.deepEqual(b, [2], 'b is not mutated'); - st.notEqual(a, combined, 'a !== combined'); - st.notEqual(b, combined, 'b !== combined'); - st.deepEqual(combined, [1, 2], 'combined is a + b'); - - st.end(); - }); - - t.test('one array, one non-array', function (st) { - var aN = 1; - var a = [aN]; - var bN = 2; - var b = [bN]; - - var combinedAnB = utils.combine(aN, b); - st.deepEqual(b, [bN], 'b is not mutated'); - st.notEqual(aN, combinedAnB, 'aN + b !== aN'); - st.notEqual(a, combinedAnB, 'aN + b !== a'); - st.notEqual(bN, combinedAnB, 'aN + b !== bN'); - st.notEqual(b, combinedAnB, 'aN + b !== b'); - st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); - - var combinedABn = utils.combine(a, bN); - st.deepEqual(a, [aN], 'a is not mutated'); - st.notEqual(aN, combinedABn, 'a + bN !== aN'); - st.notEqual(a, combinedABn, 'a + bN !== a'); - st.notEqual(bN, combinedABn, 'a + bN !== bN'); - st.notEqual(b, combinedABn, 'a + bN !== b'); - st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); - - st.end(); - }); - - t.test('neither is an array', function (st) { - var combined = utils.combine(1, 2); - st.notEqual(1, combined, '1 + 2 !== 1'); - st.notEqual(2, combined, '1 + 2 !== 2'); - st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); - - st.end(); - }); - - t.end(); -}); - -test('isBuffer()', function (t) { - forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { - t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); - }); - - var fakeBuffer = { constructor: Buffer }; - t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); - - var saferBuffer = SaferBuffer.from('abc'); - t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - - var buffer = Buffer.from ? Buffer.from('abc') : new Buffer('abc'); - t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); - t.end(); -}); diff --git a/node_modules/raw-body/HISTORY.md b/node_modules/raw-body/HISTORY.md index 88c79fc..b08ec23 100644 --- a/node_modules/raw-body/HISTORY.md +++ b/node_modules/raw-body/HISTORY.md @@ -1,15 +1,3 @@ -2.4.0 / 2019-04-17 -================== - - * deps: bytes@3.1.0 - - Add petabyte (`pb`) support - * deps: http-errors@1.7.2 - - Set constructor name when possible - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: iconv-lite@0.4.24 - - Added encoding MIK - 2.3.3 / 2018-05-08 ================== @@ -25,7 +13,7 @@ ================== * deps: iconv-lite@0.4.19 - - Fix ISO-8859-1 regression + - Fix ISO-8859-1regression - Update Windows-1255 2.3.1 / 2017-09-07 diff --git a/node_modules/raw-body/package.json b/node_modules/raw-body/package.json index 99bcd39..ebc18f4 100644 --- a/node_modules/raw-body/package.json +++ b/node_modules/raw-body/package.json @@ -1,27 +1,27 @@ { - "_from": "raw-body@2.4.0", - "_id": "raw-body@2.4.0", + "_from": "raw-body@2.3.3", + "_id": "raw-body@2.3.3", "_inBundle": false, - "_integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "_integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", "_location": "/raw-body", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "raw-body@2.4.0", + "raw": "raw-body@2.3.3", "name": "raw-body", "escapedName": "raw-body", - "rawSpec": "2.4.0", + "rawSpec": "2.3.3", "saveSpec": null, - "fetchSpec": "2.4.0" + "fetchSpec": "2.3.3" }, "_requiredBy": [ "/body-parser" ], - "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "_shasum": "a1ce6fb9c9bc356ca52e89256ab59059e13d0332", - "_spec": "raw-body@2.4.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\body-parser", + "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "_shasum": "1b324ece6b5706e153855bc1148c65bb7f6ea0c3", + "_spec": "raw-body@2.3.3", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\body-parser", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -42,24 +42,24 @@ } ], "dependencies": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", "unpipe": "1.0.0" }, "deprecated": false, "description": "Get and validate the raw body of a readable stream.", "devDependencies": { - "bluebird": "3.5.4", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", + "bluebird": "3.5.1", + "eslint": "4.19.1", + "eslint-config-standard": "11.0.0", + "eslint-plugin-import": "2.11.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "6.0.1", + "eslint-plugin-promise": "3.7.0", + "eslint-plugin-standard": "3.1.0", "istanbul": "0.4.5", - "mocha": "6.1.3", + "mocha": "2.5.3", "readable-stream": "2.3.6", "safe-buffer": "5.1.2" }, @@ -86,5 +86,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/" }, - "version": "2.4.0" + "version": "2.3.3" } diff --git a/node_modules/routes/.npmignore b/node_modules/routes/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/routes/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/routes/Makefile b/node_modules/routes/Makefile new file mode 100644 index 0000000..ced14ec --- /dev/null +++ b/node_modules/routes/Makefile @@ -0,0 +1,5 @@ +test: + node test/test.js + node test/next.js + +.PHONY: test \ No newline at end of file diff --git a/node_modules/routes/README.md b/node_modules/routes/README.md new file mode 100644 index 0000000..8a16526 --- /dev/null +++ b/node_modules/routes/README.md @@ -0,0 +1,171 @@ +# Routes.js + +`routes` lets you easily dispatch based on url-style strings. It comes with a default `Router` function that you can use to route http requests, but it also cleanly exposes the important functionality so you could also use it to perform more generic string pattern matching. + +This might make it useful for things like: + +* URI routing +* Cucumber-style pattern matching :) +* Routing messages by channel name from an MQ +* Dispatching hierarchical events by name + +## Alternative routers. + +This module is no longer actively worked on. This module operates just fine as is, + however you might want to use a module that is under active maintenance: + + - https://github.com/Matt-Esch/http-hash + - https://github.com/glassresistor/i40 + - https://github.com/bevacqua/ruta3 + +## Router Example: + +The full range of `Path Formats` is documented below. + +```js +var Router = require('routes'); +var router = Router(); +var noop = function(){}; + +router.addRoute("/articles/:title?", noop); +router.addRoute("/:controller/:action/:id.:format?", noop); + +console.log(router.match("/articles")); +console.log(router.match("/articles/never-gonna-let-you-down")); +console.log(router.match("/posts/show/1.json")); + +``` + +The output for `router.match("/posts/show/1.json")` would be: +```js +{ + params: { + controller: 'posts', + action: 'show', + id: '1', + format: 'json' + }, + splats: [], + route: '/:controller/:action/:id.:format?', + fn: [Function], + next: [Function] +} +``` + +In the example above, `fn` would be the function that was passed into the router. + + +I return this object instead of calling your function for you because you will likely want to add additional parameters from the current context to the function invocation. Ex: + +```js +var route = router.match("/posts/show/1.json"); +route.fn.apply(null, [req, res, route.params, route.splats]); +``` + +## Match Continuation + +The object returned by `router.match` includes a `next` function you can use to continue matching against subsequent routes. Routes are evaluated in the order they are added to the router, so generally, you would add your most specific routes first and most ambiguous routes last. Using the `next` function allows you evaluate more ambiguous routes first. + +```js +var Router = require('routes'); +var router = new Router(); + +router.addRoute('/admin/*?', auth); +router.addRoute('/admin/users', adminUsers); + +http.createServer(function (req, res) { + var path = url.parse(req.url).pathname; + var match = router.match(path); + match.fn(req, res, match); +}).listen(1337) + +// authenticate the user and pass them on to +// the next route, or respond with 403. +function auth(req, res, match) { + if (checkUser(req)) { + match = match.next(); + if (match) match.fn(req, res, match); + return; + } + res.statusCode = 403; + res.end() +} + +// render the admin.users page +function adminUsers(req, res, match) { + // send user list + res.statusCode = 200; + res.end(); +} +``` + +## Installation + + npm install routes + +## Path Formats + +Basic string: + + "/articles" will only match routes that == "/articles". + +Named parameters: + + "/articles/:title" will only match routes like "/articles/hello", but *not* "/articles/". + +Optional named parameters: + + "/articles/:title?" will match "/articles/hello" AND "/articles/" + +Periods before optional parameters are also optional: + + "/:n.:f?" will match "/1" and "/1.json" + +Splaaaat! : + + "/assets/*" will match "/assets/blah/blah/blah.png" and "/assets/". + + "/assets/*.*" will match "/assets/1/2/3.js" as splats: ["1/2/3", "js"] + +Mix splat with named parameters: + + "/account/:id/assets/*" will match "/account/2/assets/folder.png" as params: {id: 2}, splats:["folder.png"] + + +Named RegExp: + + "/lang/:lang([a-z]{2})" will match "/lang/en" but not "/lang/12" or "/lang/eng" + +Raw RegExp: + + /^\/(\d{2,3}-\d{2,3}-\d{4})\.(\w*)$/ (note no quotes, this is a RegExp, not a string.) will match "/123-22-1234.json". Each match group will be an entry in splats: ["123-22-1234", "json"] + + +## Router API + +The `Router()` that `routes` exposes has two functions: `addRoute` and `match`. + +`addRoute`: takes a `path` and a `fn`. Your `path` can match any of the formats in the "Path Formats" section. + +`match`: takes a `String` or `RegExp` and returns an object that contains the named `params`, `splats`, `route` (string that was matched against), the `fn` handler you passed in with `addRoute`, and a `next` function which will run `match` against subsequent routes. + +## Library API + +`match`: takes an array of `Routes`, and a `String`. It goes through `Routes` and returns an object for the first `Route` that matches the `String`, or `undefined` if none is found. The returned object contains `params`, `splats`, and `route`. `params` is an object containing the named matches, `splats` contains the unnamed globs ("*"), and `route` contains the original string that was matched against. + +`pathToRegExp`: takes a `path` string and an empty `keys` array, returns a RegExp and populates `keys` with the names of the match groups that the RegExp will match. This is largely an internal function but is provided in case someone wants to make a nifty string -> [RegExp, keys] utility. + + +## Test + +Clone the repo, cd to it, and: + + make test + +## Credits + +This library is an extraction and re-factor of the `connect` `router` middleware. I found that connect-based routing worked reasonably well on the server side, but I wanted to do similar routing based on channel names when using `Push-It` and possibly for event names when using `Evan`. So, I extracted the relevant goodness out of the `router` middleware and presented it here. Big thanks to TJ Holowaychuk for writing the original `router` middleware. + +## License + +This code is distributed under the MIT license, Copyright Aaron Blohowiak and TJ Holowaychuk 2011. diff --git a/node_modules/routes/dist/routes.js b/node_modules/routes/dist/routes.js new file mode 100644 index 0000000..568a036 --- /dev/null +++ b/node_modules/routes/dist/routes.js @@ -0,0 +1,184 @@ +!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.routes=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o dist/routes.js", + "test": "make test" + }, + "version": "2.1.0" +} diff --git a/node_modules/routes/test/example.js b/node_modules/routes/test/example.js new file mode 100644 index 0000000..984a36c --- /dev/null +++ b/node_modules/routes/test/example.js @@ -0,0 +1,13 @@ +var Router = require("../index"); +var router = Router(); + +var noop = function(){}; + +router.addRoute("/articles/:title?", noop); +router.addRoute("/assets/*", noop); +router.addRoute("/:controller/:action/:id.:format?", noop); + +console.log(router.match("/articles")); +console.log(router.match("/articles/never-gonna-let-you-down")); +console.log(router.match("/assets/one/two/three/pic.jpg")); +console.log(router.match("/posts/show/1.json")); \ No newline at end of file diff --git a/node_modules/routes/test/next.js b/node_modules/routes/test/next.js new file mode 100644 index 0000000..80b2664 --- /dev/null +++ b/node_modules/routes/test/next.js @@ -0,0 +1,108 @@ +var assert = require("assert") +var http = require('http') +var url = require('url') +var Routes = require('../index') +var router = new Routes() + +router.addRoute('/*?', staticFiles) +router.addRoute('/admin/*?', auth) +router.addRoute('/admin/users', adminUsers) +router.addRoute('/*', notFound) + +var server = http.createServer(function (req, res) { + var path = url.parse(req.url).pathname + var match = router.match(path) + + function wrapNext(next) { + return function() { + var match = next() + match.fn(req, res, wrapNext(match.next)) + } + } + + match.fn(req, res, wrapNext(match.next)) + +}).listen(1337, runTests) + +// serve the file or pass it on +function staticFiles(req, res, next) { + var qs = url.parse(req.url, true).query + if (qs.img) { + res.statusCode = 304 + res.end() + } + else { + res.setHeader('x-static', 'next') + next() + } +} + +// authenticate the user and pass them on +// or 403 them +function auth(req, res, next) { + var qs = url.parse(req.url, true).query + if (qs.user) { + res.setHeader('x-auth', 'next') + return next() + } + res.statusCode = 403 + res.end() +} + +// render the admin.users page +function adminUsers(req, res, next) { + res.statusCode = 200 + res.end() +} + +function notFound(req, res, next) { + res.statusCode = 404 + return res.end() +} + + +function httpError(err) { + console.error('An error occurred:', err) + tryClose() +} + +function runTests() { + + http.get("http://localhost:1337/?img=1", function(res) { + console.log('Match \\*? and return 304') + assert.equal(res.statusCode, 304) + assert.notEqual(res.headers['x-static'], 'next') + tryClose() + }).on('error', httpError) + + http.get("http://localhost:1337/admin/users", function(res) { + console.log('Match \\admin\\* and return 403') + assert.equal(res.statusCode, 403) + assert.equal(res.headers['x-static'], 'next') + tryClose() + }).on('error', httpError) + + http.get("http://localhost:1337/admin/users?user=1", function(res) { + console.log('Match \\admin\\users and return 200') + assert.equal(res.statusCode, 200) + assert.equal(res.headers['x-static'], 'next') + assert.equal(res.headers['x-auth'], 'next') + tryClose() + }).on('error', httpError) + + http.get("http://localhost:1337/something-else", function(res) { + console.log('Match \\*? but not an image and return 404') + assert.equal(res.statusCode, 404) + assert.equal(res.headers['x-static'], 'next') + tryClose() + }).on('error', httpError) + +} + +var waitingFor = 4 +function tryClose() { + waitingFor-- + if (!waitingFor) { + process.exit() + } +} \ No newline at end of file diff --git a/node_modules/routes/test/test.js b/node_modules/routes/test/test.js new file mode 100644 index 0000000..07ed264 --- /dev/null +++ b/node_modules/routes/test/test.js @@ -0,0 +1,273 @@ +var assert = require("assert"), + Router = require("../index"), + router = Router(); + +(function(){ + //avoid typing assert.blah all over + for(k in assert){ + this[k] = assert[k]; + } +})(); + +equal(1, 1); + +var noop = function(){}; + +var cases = [ + { + path: "/lang", + testMatch: { + "/lang" :{ + fn: noop, + params: {}, + splats: [] + }, + "/lang/" :{ + fn: noop, + params: {}, + splats: [] + } + } + }, + { + path: "/lang/:lang([a-z]{2})", + testMatch :{ + "/lang/de":{ + fn: noop, + params: { + "lang":"de" + }, + splats:[] + } + }, + testNoMatch: ["/lang/who", "/lang/toolong", "/lang/1"] + }, + { + path: "/normal/:id", + testMatch: { + "/normal/1":{ + fn: noop, + params: { + id: "1" + }, + splats: [] + } + }, + testNoMatch: ["/normal/1/updates"] + }, + { + path: "/optional/:id?", + testMatch: { + "/optional/1":{ + fn: noop, + params: { + id: "1" + }, + splats: [] + }, + "/optional/":{ + fn: noop, + params: { + id: undefined + }, + splats: [] + } + }, + testNoMatch: ["/optional/1/blah"] + }, + { + path: "/empty/*", + testMatch: { + "/empty/":{ + fn: noop, + params: { }, + splats:[""], + } + }, + testNomatch: [ "/empty" ] + }, + { + path: "/whatever/*.*", + testMatch: { + "/whatever/1/2/3.js":{ + fn: noop, + params: { }, + splats:["1/2/3", "js"], + } + }, + testNomatch: [ "/whatever/" ] + }, + { + path: "/files/*.*", + testMatch: { + "/files/hi.json":{ + fn: noop, + params: {}, + splats: ["hi", "json"] + }, + "/files/blah/blah.js":{ + fn: noop, + params: {}, + splats: ["blah/blah", "js"] + } + }, + testNoMatch: ["/files/", "/files/blah"] + }, + { + path: "/transitive/:kind/:id/:method?.:format?", + testMatch: { + "/transitive/users/ekjnekjnfkej": { + fn: noop, + params: { + "kind":"users", + "id":"ekjnekjnfkej", + "method": undefined, + "format": undefined }, + splats:[], + }, + "/transitive/users/ekjnekjnfkej/update": { + fn: noop, + params: { + "kind":"users", + "id":"ekjnekjnfkej", + "method": "update", + "format": undefined }, + splats:[], + }, + "/transitive/users/ekjnekjnfkej/update.json": { + fn: noop, + params: { + "kind":"users", + "id":"ekjnekjnfkej", + "method": "update", + "format": "json" }, + splats:[], + } + }, + testNoMatch: ["/transitive/kind/", "/transitive/"] + }, + { + path: /^\/(\d{2,3}-\d{2,3}-\d{4})\.(\w*)$/, + testMatch :{ + "/123-22-1234.json":{ + fn: noop, + params: {}, + splats:["123-22-1234", "json"] + } + }, + testNoMatch: ["/123-1-1234.png", "/123-22-1234", "/123.png"] + }, + { + path: "/cat/*", + testMatch: { + "/cat/%" :{ + fn: noop, + params: {}, + splats: ['%'] + } + } + }, + { + path: "*://*example.com/:foo/*/:bar", + testMatch: { + "http://www.example.com/the/best/test" :{ + fn: noop, + params: { + "foo":"the", + "bar":"test" + }, + splats: ["http","www.","best"] + } + } + }, + { + path: "*://*example2.com/:foo/*/:bar", + testMatch: { + "http://example2.com/the/best/test" :{ + fn: noop, + params: { + "foo":"the", + "bar":"test" + }, + splats: ["http","","best"] + } + } + } +]; + +//load routes +for(caseIdx in cases){ + test = cases[caseIdx]; + router.addRoute(test.path, noop); +} + +var assertCount = 0; + +//run tests +for(caseIdx in cases){ + test = cases[caseIdx]; + for(path in test.testMatch){ + match = router.match(path); + fixture = test.testMatch[path]; + + //save typing in fixtures + fixture.route = test.path.toString(); // match gets string, so ensure same type + delete match.next; // next shouldn't be compared + deepEqual(match, fixture); + assertCount++; + } + + for(noMatchIdx in test.testNoMatch){ + match = router.match(test.testNoMatch[noMatchIdx]); + strictEqual(match, undefined); + assertCount++; + } +} + +//test exceptions +assert.throws( + function() { + router.addRoute(); + } + , /route requires a path/ + , "expected 'route requires a path' error" +); + +assertCount++; + +assert.throws( + function() { + router.addRoute('/'); + } + , /route \/ requires a callback/ + , "expected 'route requries a callback' error" +); + +assertCount++; + +// test next +router.addRoute("/*?", noop); +router.addRoute("/next/x", noop); +var match = router.match("/next/x"); +equal(typeof match.next, "function") +strictEqual(match.route, "/*?"); +assertCount++; +var next = match.next(); +strictEqual(next.route, "/next/x"); +assertCount++; + +// test remove +equal(router.routes.length, 14); +equal(Object.keys(router.routeMap).length, 14); +router.removeRoute('/next/x'); +equal(router.routes.length, 13); +equal(Object.keys(router.routeMap).length, 13); +assertCount++; +match = router.match('/next/x'); +// next still available, just returns undefined +equal(typeof match.next, "function"); +next = match.next(); +strictEqual(next, undefined); +assertCount++ + +console.log(assertCount.toString()+ " assertions made succesfully"); diff --git a/node_modules/send/HISTORY.md b/node_modules/send/HISTORY.md index d14ac06..88ab930 100644 --- a/node_modules/send/HISTORY.md +++ b/node_modules/send/HISTORY.md @@ -1,37 +1,3 @@ -0.17.1 / 2019-05-10 -=================== - - * Set stricter CSP header in redirect & error responses - * deps: range-parser@~1.2.1 - -0.17.0 / 2019-05-03 -=================== - - * deps: http-errors@~1.7.2 - - Set constructor name when possible - - Use `toidentifier` module to make class names - - deps: depd@~1.1.2 - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: mime@1.6.0 - - Add extensions for JPEG-2000 images - - Add new `font/*` types from IANA - - Add WASM mapping - - Update `.bdoc` to `application/bdoc` - - Update `.bmp` to `image/bmp` - - Update `.m4a` to `audio/mp4` - - Update `.rtf` to `application/rtf` - - Update `.wav` to `audio/wav` - - Update `.xml` to `application/xml` - - Update generic extensions to `application/octet-stream`: - `.deb`, `.dll`, `.dmg`, `.exe`, `.iso`, `.msi` - - Use mime-score module to resolve extension conflicts - * deps: ms@2.1.1 - - Add `week`/`w` support - - Fix negative number handling - * deps: statuses@~1.5.0 - * perf: remove redundant `path.normalize` call - 0.16.2 / 2018-02-07 =================== diff --git a/node_modules/send/README.md b/node_modules/send/README.md index 179e8c3..1a24403 100644 --- a/node_modules/send/README.md +++ b/node_modules/send/README.md @@ -1,7 +1,7 @@ # send -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url] @@ -174,27 +174,7 @@ $ npm test ## Examples -### Serve a specific file - -This simple example will send a specific file to all requests. - -```js -var http = require('http') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - send(req, '/path/to/index.html') - .pipe(res) -}) - -server.listen(3000) -``` - -### Serve all files from a directory - -This simple example will just serve up all the files in a -given directory as the top-level. For example, a request -`GET /foo.txt` will send back `/www/public/foo.txt`. +### Small example ```js var http = require('http') @@ -202,8 +182,7 @@ var parseUrl = require('parseurl') var send = require('send') var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .pipe(res) + send(req, parseUrl(req).pathname).pipe(res) }) server.listen(3000) @@ -225,8 +204,7 @@ send.mime.define({ }) var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .pipe(res) + send(req, parseUrl(req).pathname).pipe(res) }) server.listen(3000) @@ -246,9 +224,9 @@ var send = require('send') // Transfer arbitrary files from within /www/example.com/public/* // with a custom handler for directory listing var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) - .once('directory', directory) - .pipe(res) + send(req, parseUrl(req).pathname, {index: false, root: '/www/example.com/public'}) + .once('directory', directory) + .pipe(res) }) server.listen(3000) @@ -302,11 +280,11 @@ var server = http.createServer(function onRequest (req, res) { // transfer arbitrary files from within // /www/example.com/public/* - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .on('error', error) - .on('directory', redirect) - .on('headers', headers) - .pipe(res) + send(req, parseUrl(req).pathname, {root: '/www/example.com/public'}) + .on('error', error) + .on('directory', redirect) + .on('headers', headers) + .pipe(res) }) server.listen(3000) @@ -316,14 +294,13 @@ server.listen(3000) [MIT](LICENSE) -[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/send/master?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send -[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master -[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master -[node-image]: https://badgen.net/npm/node/send -[node-url]: https://nodejs.org/en/download/ -[npm-downloads-image]: https://badgen.net/npm/dm/send +[npm-image]: https://img.shields.io/npm/v/send.svg [npm-url]: https://npmjs.org/package/send -[npm-version-image]: https://badgen.net/npm/v/send -[travis-image]: https://badgen.net/travis/pillarjs/send/master?label=linux +[travis-image]: https://img.shields.io/travis/pillarjs/send/master.svg?label=linux [travis-url]: https://travis-ci.org/pillarjs/send +[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/send/master.svg?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/send/master.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master +[downloads-image]: https://img.shields.io/npm/dm/send.svg +[downloads-url]: https://npmjs.org/package/send diff --git a/node_modules/send/index.js b/node_modules/send/index.js index fca2112..f297c4c 100644 --- a/node_modules/send/index.js +++ b/node_modules/send/index.js @@ -288,7 +288,7 @@ SendStream.prototype.error = function error (status, err) { res.statusCode = status res.setHeader('Content-Type', 'text/html; charset=UTF-8') res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('Content-Security-Policy', "default-src 'self'") res.setHeader('X-Content-Type-Options', 'nosniff') res.end(doc) } @@ -493,7 +493,7 @@ SendStream.prototype.redirect = function redirect (path) { res.statusCode = 301 res.setHeader('Content-Type', 'text/html; charset=UTF-8') res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('Content-Security-Policy', "default-src 'self'") res.setHeader('X-Content-Type-Options', 'nosniff') res.setHeader('Location', loc) res.end(doc) @@ -546,6 +546,7 @@ SendStream.prototype.pipe = function pipe (res) { // join / normalize from optional root dir path = normalize(join(root, path)) + root = normalize(root + sep) } else { // ".." is malicious without "root" if (UP_PATH_REGEXP.test(path)) { @@ -668,7 +669,7 @@ SendStream.prototype.send = function send (path, stat) { // 416 Requested Range Not Satisfiable return this.error(416, { - headers: { 'Content-Range': res.getHeader('Content-Range') } + headers: {'Content-Range': res.getHeader('Content-Range')} }) } diff --git a/node_modules/send/node_modules/ms/index.js b/node_modules/send/node_modules/ms/index.js deleted file mode 100644 index 7229750..0000000 --- a/node_modules/send/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/node_modules/send/node_modules/ms/license.md b/node_modules/send/node_modules/ms/license.md deleted file mode 100644 index 69b6125..0000000 --- a/node_modules/send/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -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/send/node_modules/ms/package.json b/node_modules/send/node_modules/ms/package.json deleted file mode 100644 index 40045d2..0000000 --- a/node_modules/send/node_modules/ms/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "ms@2.1.1", - "_id": "ms@2.1.1", - "_inBundle": false, - "_integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "_location": "/send/ms", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "ms@2.1.1", - "name": "ms", - "escapedName": "ms", - "rawSpec": "2.1.1", - "saveSpec": null, - "fetchSpec": "2.1.1" - }, - "_requiredBy": [ - "/send" - ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "_shasum": "30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a", - "_spec": "ms@2.1.1", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\send", - "bugs": { - "url": "https://github.com/zeit/ms/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Tiny millisecond conversion utility", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/zeit/ms#readme", - "license": "MIT", - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "main": "./index", - "name": "ms", - "repository": { - "type": "git", - "url": "git+https://github.com/zeit/ms.git" - }, - "scripts": { - "lint": "eslint lib/* bin/*", - "precommit": "lint-staged", - "test": "mocha tests.js" - }, - "version": "2.1.1" -} diff --git a/node_modules/send/node_modules/ms/readme.md b/node_modules/send/node_modules/ms/readme.md deleted file mode 100644 index bb76729..0000000 --- a/node_modules/send/node_modules/ms/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# ms - -[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/node_modules/send/package.json b/node_modules/send/package.json index 16cca7c..3c658c0 100644 --- a/node_modules/send/package.json +++ b/node_modules/send/package.json @@ -1,28 +1,28 @@ { - "_from": "send@0.17.1", - "_id": "send@0.17.1", + "_from": "send@0.16.2", + "_id": "send@0.16.2", "_inBundle": false, - "_integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "_integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "_location": "/send", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "send@0.17.1", + "raw": "send@0.16.2", "name": "send", "escapedName": "send", - "rawSpec": "0.17.1", + "rawSpec": "0.16.2", "saveSpec": null, - "fetchSpec": "0.17.1" + "fetchSpec": "0.16.2" }, "_requiredBy": [ "/express", "/serve-static" ], - "_resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "_shasum": "c1d8b059f7900f7466dd4938bdc44e11ddb376c8", - "_spec": "send@0.17.1", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "_shasum": "6ecca1e0f8c156d141597559848df64730a6bbc1", + "_spec": "send@0.16.2", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -53,27 +53,27 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "deprecated": false, "description": "Better streaming static file server with Range and conditional-GET support", "devDependencies": { "after": "0.8.2", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.8.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.2.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", - "mocha": "6.1.4", - "supertest": "4.0.2" + "mocha": "2.5.3", + "supertest": "1.1.0" }, "engines": { "node": ">= 0.8.0" @@ -102,5 +102,5 @@ "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.17.1" + "version": "0.16.2" } diff --git a/node_modules/serve-static/HISTORY.md b/node_modules/serve-static/HISTORY.md index 7203e4f..6886ce5 100644 --- a/node_modules/serve-static/HISTORY.md +++ b/node_modules/serve-static/HISTORY.md @@ -1,21 +1,3 @@ -1.14.1 / 2019-05-10 -=================== - - * Set stricter CSP header in redirect response - * deps: send@0.17.1 - - deps: range-parser@~1.2.1 - -1.14.0 / 2019-05-07 -=================== - - * deps: parseurl@~1.3.3 - * deps: send@0.17.0 - - deps: http-errors@~1.7.2 - - deps: mime@1.6.0 - - deps: ms@2.1.1 - - deps: statuses@~1.5.0 - - perf: remove redundant `path.normalize` call - 1.13.2 / 2018-02-07 =================== diff --git a/node_modules/serve-static/README.md b/node_modules/serve-static/README.md index 7cce428..269becb 100644 --- a/node_modules/serve-static/README.md +++ b/node_modules/serve-static/README.md @@ -1,7 +1,7 @@ # serve-static -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url] @@ -141,7 +141,7 @@ var http = require('http') var serveStatic = require('serve-static') // Serve up public/ftp folder -var serve = serveStatic('public/ftp', { 'index': ['index.html', 'index.htm'] }) +var serve = serveStatic('public/ftp', {'index': ['index.html', 'index.htm']}) // Create server var server = http.createServer(function onRequest (req, res) { @@ -192,7 +192,7 @@ var serveStatic = require('serve-static') var app = express() -app.use(serveStatic('public/ftp', { 'index': ['default.html', 'default.htm'] })) +app.use(serveStatic('public/ftp', {'index': ['default.html', 'default.htm']})) app.listen(3000) ``` @@ -246,14 +246,13 @@ function setCustomCacheControl (res, path) { [MIT](LICENSE) -[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static -[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master -[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master -[node-image]: https://badgen.net/npm/node/serve-static -[node-url]: https://nodejs.org/en/download/ -[npm-downloads-image]: https://badgen.net/npm/dm/serve-static +[npm-image]: https://img.shields.io/npm/v/serve-static.svg [npm-url]: https://npmjs.org/package/serve-static -[npm-version-image]: https://badgen.net/npm/v/serve-static -[travis-image]: https://badgen.net/travis/expressjs/serve-static/master?label=linux +[travis-image]: https://img.shields.io/travis/expressjs/serve-static/master.svg?label=linux [travis-url]: https://travis-ci.org/expressjs/serve-static +[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-static/master.svg?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static +[coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-static/master.svg +[coveralls-url]: https://coveralls.io/r/expressjs/serve-static +[downloads-image]: https://img.shields.io/npm/dm/serve-static.svg +[downloads-url]: https://npmjs.org/package/serve-static diff --git a/node_modules/serve-static/index.js b/node_modules/serve-static/index.js index b7d3984..75ddd29 100644 --- a/node_modules/serve-static/index.js +++ b/node_modules/serve-static/index.js @@ -142,7 +142,7 @@ function collapseLeadingSlashes (str) { : str } -/** + /** * Create a minimal HTML document. * * @param {string} title @@ -202,7 +202,7 @@ function createRedirectDirectoryListener () { res.statusCode = 301 res.setHeader('Content-Type', 'text/html; charset=UTF-8') res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('Content-Security-Policy', "default-src 'self'") res.setHeader('X-Content-Type-Options', 'nosniff') res.setHeader('Location', loc) res.end(doc) diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json index 9d29354..f517fa6 100644 --- a/node_modules/serve-static/package.json +++ b/node_modules/serve-static/package.json @@ -1,27 +1,27 @@ { - "_from": "serve-static@1.14.1", - "_id": "serve-static@1.14.1", + "_from": "serve-static@1.13.2", + "_id": "serve-static@1.13.2", "_inBundle": false, - "_integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "_integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "_location": "/serve-static", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "serve-static@1.14.1", + "raw": "serve-static@1.13.2", "name": "serve-static", "escapedName": "serve-static", - "rawSpec": "1.14.1", + "rawSpec": "1.13.2", "saveSpec": null, - "fetchSpec": "1.14.1" + "fetchSpec": "1.13.2" }, "_requiredBy": [ "/express" ], - "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "_shasum": "666e636dc4f010f7ef29970a88a674320898b2f9", - "_spec": "serve-static@1.14.1", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "_shasum": "095e8472fd5b46237db50ce486a43f4b86c6cec1", + "_spec": "serve-static@1.13.2", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "author": { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" @@ -33,23 +33,22 @@ "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" + "parseurl": "~1.3.2", + "send": "0.16.2" }, "deprecated": false, "description": "Serve static files", "devDependencies": { - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.8.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.2.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", - "mocha": "6.1.4", - "safe-buffer": "5.1.2", - "supertest": "4.0.2" + "mocha": "2.5.3", + "supertest": "1.1.0" }, "engines": { "node": ">= 0.8.0" @@ -70,8 +69,7 @@ "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", "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": "node scripts/version-history.js && git add HISTORY.md" + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" }, - "version": "1.14.1" + "version": "1.13.2" } diff --git a/node_modules/setprototypeof/README.md b/node_modules/setprototypeof/README.md index f120044..826bf02 100644 --- a/node_modules/setprototypeof/README.md +++ b/node_modules/setprototypeof/README.md @@ -1,9 +1,5 @@ # Polyfill for `Object.setPrototypeOf` -[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) -[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) - A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. ## Usage: @@ -13,19 +9,18 @@ $ npm install --save setprototypeof ``` ```javascript -var setPrototypeOf = require('setprototypeof') +var setPrototypeOf = require('setprototypeof'); -var obj = {} +var obj = {}; setPrototypeOf(obj, { - foo: function () { - return 'bar' - } -}) -obj.foo() // bar + foo: function() { + return 'bar'; + } +}); +obj.foo(); // bar ``` TypeScript is also supported: - ```typescript -import setPrototypeOf = require('setprototypeof') -``` +import setPrototypeOf = require('setprototypeof'); +``` \ No newline at end of file diff --git a/node_modules/setprototypeof/index.js b/node_modules/setprototypeof/index.js index 81fd5d7..93ea417 100644 --- a/node_modules/setprototypeof/index.js +++ b/node_modules/setprototypeof/index.js @@ -1,17 +1,15 @@ -'use strict' -/* eslint no-proto: 0 */ -module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) +module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties); -function setProtoOf (obj, proto) { - obj.__proto__ = proto - return obj +function setProtoOf(obj, proto) { + obj.__proto__ = proto; + return obj; } -function mixinProperties (obj, proto) { - for (var prop in proto) { - if (!obj.hasOwnProperty(prop)) { - obj[prop] = proto[prop] - } - } - return obj +function mixinProperties(obj, proto) { + for (var prop in proto) { + if (!obj.hasOwnProperty(prop)) { + obj[prop] = proto[prop]; + } + } + return obj; } diff --git a/node_modules/setprototypeof/package.json b/node_modules/setprototypeof/package.json index cfa07d1..f10e3b2 100644 --- a/node_modules/setprototypeof/package.json +++ b/node_modules/setprototypeof/package.json @@ -1,28 +1,28 @@ { - "_from": "setprototypeof@1.1.1", - "_id": "setprototypeof@1.1.1", + "_from": "setprototypeof@1.1.0", + "_id": "setprototypeof@1.1.0", "_inBundle": false, - "_integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "_integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", "_location": "/setprototypeof", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "setprototypeof@1.1.1", + "raw": "setprototypeof@1.1.0", "name": "setprototypeof", "escapedName": "setprototypeof", - "rawSpec": "1.1.1", + "rawSpec": "1.1.0", "saveSpec": null, - "fetchSpec": "1.1.1" + "fetchSpec": "1.1.0" }, "_requiredBy": [ "/express", "/http-errors" ], - "_resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "_shasum": "7e95acb24aa92f5885e0abef5ba131330d4ae683", - "_spec": "setprototypeof@1.1.1", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "_shasum": "d0bd85536887b6fe7c0d818cb962d9d91c54e656", + "_spec": "setprototypeof@1.1.0", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "author": { "name": "Wes Todd" }, @@ -32,10 +32,6 @@ "bundleDependencies": false, "deprecated": false, "description": "A small polyfill for Object.setprototypeof", - "devDependencies": { - "mocha": "^5.2.0", - "standard": "^12.0.1" - }, "homepage": "https://github.com/wesleytodd/setprototypeof", "keywords": [ "polyfill", @@ -50,15 +46,8 @@ "url": "git+https://github.com/wesleytodd/setprototypeof.git" }, "scripts": { - "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion", - "node11": "NODE_VER=11 npm run testversion", - "node4": "NODE_VER=4 npm run testversion", - "node6": "NODE_VER=6 npm run testversion", - "node9": "NODE_VER=9 npm run testversion", - "test": "standard && mocha", - "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11", - "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t" + "test": "echo \"Error: no test specified\" && exit 1" }, "typings": "index.d.ts", - "version": "1.1.1" + "version": "1.1.0" } diff --git a/node_modules/setprototypeof/test/index.js b/node_modules/setprototypeof/test/index.js deleted file mode 100644 index afeb4dd..0000000 --- a/node_modules/setprototypeof/test/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' -/* eslint-env mocha */ -/* eslint no-proto: 0 */ -var assert = require('assert') -var setPrototypeOf = require('..') - -describe('setProtoOf(obj, proto)', function () { - it('should merge objects', function () { - var obj = { a: 1, b: 2 } - var proto = { b: 3, c: 4 } - var mergeObj = setPrototypeOf(obj, proto) - - if (Object.getPrototypeOf) { - assert.strictEqual(Object.getPrototypeOf(obj), proto) - } else if ({ __proto__: [] } instanceof Array) { - assert.strictEqual(obj.__proto__, proto) - } else { - assert.strictEqual(obj.a, 1) - assert.strictEqual(obj.b, 2) - assert.strictEqual(obj.c, 4) - } - assert.strictEqual(mergeObj, obj) - }) -}) diff --git a/node_modules/statuses/HISTORY.md b/node_modules/statuses/HISTORY.md index a1977b2..7b59790 100644 --- a/node_modules/statuses/HISTORY.md +++ b/node_modules/statuses/HISTORY.md @@ -1,8 +1,3 @@ -1.5.0 / 2018-03-27 -================== - - * Add `103 Early Hints` - 1.4.0 / 2017-10-20 ================== diff --git a/node_modules/statuses/codes.json b/node_modules/statuses/codes.json index a09283a..66f70e3 100644 --- a/node_modules/statuses/codes.json +++ b/node_modules/statuses/codes.json @@ -2,7 +2,6 @@ "100": "Continue", "101": "Switching Protocols", "102": "Processing", - "103": "Early Hints", "200": "OK", "201": "Created", "202": "Accepted", diff --git a/node_modules/statuses/package.json b/node_modules/statuses/package.json index f161ab0..368d82c 100644 --- a/node_modules/statuses/package.json +++ b/node_modules/statuses/package.json @@ -1,19 +1,19 @@ { - "_from": "statuses@~1.5.0", - "_id": "statuses@1.5.0", + "_from": "statuses@~1.4.0", + "_id": "statuses@1.4.0", "_inBundle": false, - "_integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "_integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", "_location": "/statuses", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "statuses@~1.5.0", + "raw": "statuses@~1.4.0", "name": "statuses", "escapedName": "statuses", - "rawSpec": "~1.5.0", + "rawSpec": "~1.4.0", "saveSpec": null, - "fetchSpec": "~1.5.0" + "fetchSpec": "~1.4.0" }, "_requiredBy": [ "/express", @@ -21,10 +21,10 @@ "/http-errors", "/send" ], - "_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "_shasum": "161c7dac177659fd9811f43771fa99381478628c", - "_spec": "statuses@~1.5.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\express", + "_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "_shasum": "bb73d446da2796106efcc1b601a253d6c46bd087", + "_spec": "statuses@~1.4.0", + "_where": "C:\\Users\\prarthana\\Downloads\\New folder\\NewsBlog\\node_modules\\express", "bugs": { "url": "https://github.com/jshttp/statuses/issues" }, @@ -44,12 +44,12 @@ "description": "HTTP status utility", "devDependencies": { "csv-parse": "1.2.4", - "eslint": "4.19.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.9.0", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.8.0", "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.7.0", + "eslint-plugin-node": "5.2.0", + "eslint-plugin-promise": "3.6.0", "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", "mocha": "1.21.5", @@ -86,5 +86,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "update": "npm run fetch && npm run build" }, - "version": "1.5.0" + "version": "1.4.0" } diff --git a/node_modules/toidentifier/LICENSE b/node_modules/toidentifier/LICENSE deleted file mode 100644 index de22d15..0000000 --- a/node_modules/toidentifier/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/toidentifier/README.md b/node_modules/toidentifier/README.md deleted file mode 100644 index 7c8794e..0000000 --- a/node_modules/toidentifier/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# toidentifier - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][codecov-image]][codecov-url] - -> Convert a string of words to a JavaScript identifier - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install toidentifier -``` - -## Example - -```js -var toIdentifier = require('toidentifier') - -console.log(toIdentifier('Bad Request')) -// => "BadRequest" -``` - -## API - -This CommonJS module exports a single default function: `toIdentifier`. - -### toIdentifier(string) - -Given a string as the argument, it will be transformed according to -the following rules and the new string will be returned: - -1. Split into words separated by space characters (`0x20`). -2. Upper case the first character of each word. -3. Join the words together with no separator. -4. Remove all non-word (`[0-9a-z_]`) characters. - -## License - -[MIT](LICENSE) - -[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg -[codecov-url]: https://codecov.io/gh/component/toidentifier -[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg -[downloads-url]: https://npmjs.org/package/toidentifier -[npm-image]: https://img.shields.io/npm/v/toidentifier.svg -[npm-url]: https://npmjs.org/package/toidentifier -[travis-image]: https://img.shields.io/travis/component/toidentifier/master.svg -[travis-url]: https://travis-ci.org/component/toidentifier - - -## - -[npm]: https://www.npmjs.com/ - -[yarn]: https://yarnpkg.com/ diff --git a/node_modules/toidentifier/index.js b/node_modules/toidentifier/index.js deleted file mode 100644 index bba5411..0000000 --- a/node_modules/toidentifier/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/*! - * toidentifier - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - * @public - */ - -module.exports = toIdentifier - -/** - * Trasform the given string into a JavaScript identifier - * - * @param {string} str - * @returns {string} - * @public - */ - -function toIdentifier (str) { - return str - .split(' ') - .map(function (token) { - return token.slice(0, 1).toUpperCase() + token.slice(1) - }) - .join('') - .replace(/[^ _0-9a-z]/gi, '') -} diff --git a/node_modules/toidentifier/package.json b/node_modules/toidentifier/package.json deleted file mode 100644 index a1ff111..0000000 --- a/node_modules/toidentifier/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "toidentifier@1.0.0", - "_id": "toidentifier@1.0.0", - "_inBundle": false, - "_integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "_location": "/toidentifier", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "toidentifier@1.0.0", - "name": "toidentifier", - "escapedName": "toidentifier", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/http-errors" - ], - "_resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "_shasum": "7e1be3470f1e77948bc43d94a3c8f4d7752ba553", - "_spec": "toidentifier@1.0.0", - "_where": "C:\\Users\\Udari\\Desktop\\News\\node_modules\\http-errors", - "author": { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - "bugs": { - "url": "https://github.com/component/toidentifier/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Nick Baugh", - "email": "niftylettuce@gmail.com", - "url": "http://niftylettuce.com/" - } - ], - "deprecated": false, - "description": "Convert a string of words to a JavaScript identifier", - "devDependencies": { - "eslint": "4.19.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.11.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.7.0", - "eslint-plugin-standard": "3.1.0", - "mocha": "1.21.5", - "nyc": "11.8.0" - }, - "engines": { - "node": ">=0.6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/component/toidentifier#readme", - "license": "MIT", - "name": "toidentifier", - "repository": { - "type": "git", - "url": "git+https://github.com/component/toidentifier.git" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "nyc --reporter=html --reporter=text npm test" - }, - "version": "1.0.0" -} diff --git a/package-lock.json b/package-lock.json index 95f6f21..fc79731 100644 --- a/package-lock.json +++ b/package-lock.json @@ -113,20 +113,20 @@ "dev": true }, "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", "requires": { - "bytes": "3.1.0", + "bytes": "3.0.0", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" } }, "boxen": { @@ -240,9 +240,9 @@ } }, "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, "cacheable-request": { "version": "6.1.0", @@ -367,12 +367,9 @@ "integrity": "sha1-2GMPJtlaf4UfmVax6MxnMvO2qjA=" }, "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "requires": { - "safe-buffer": "5.1.2" - } + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-type": { "version": "1.0.4", @@ -531,40 +528,47 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", "requires": { - "accepts": "~1.3.7", + "accepts": "~1.3.5", "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", "content-type": "~1.0.4", - "cookie": "0.4.0", + "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", - "parseurl": "~1.3.3", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", "vary": "~1.1.2" + }, + "dependencies": { + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + } } }, "express-ejs-layouts": { @@ -630,16 +634,16 @@ } }, "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", "unpipe": "~1.0.0" } }, @@ -730,21 +734,20 @@ "dev": true }, "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { "depd": "~1.1.2", "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" } }, "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -967,9 +970,9 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { "version": "1.51.0", @@ -1264,9 +1267,9 @@ } }, "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "random-bytes": { "version": "1.0.0", @@ -1279,13 +1282,13 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", "unpipe": "1.0.0" } }, @@ -1350,6 +1353,11 @@ "lowercase-keys": "^1.0.0" } }, + "routes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/routes/-/routes-2.1.0.tgz", + "integrity": "sha1-R1VxGSpI+ZtsBl3ZJrt16K6D6KI=" + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -1393,9 +1401,9 @@ } }, "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", "depd": "~1.1.2", @@ -1404,36 +1412,29 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } + "range-parser": "~1.2.0", + "statuses": "~1.4.0" } }, "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" + "parseurl": "~1.3.2", + "send": "0.16.2" } }, "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, "sift": { "version": "13.5.2", @@ -1461,9 +1462,9 @@ } }, "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, "streamsearch": { "version": "0.1.2", @@ -1519,11 +1520,6 @@ "is-number": "^7.0.0" } }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" - }, "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", diff --git a/package.json b/package.json index 02b0e3b..e908c0a 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,13 @@ "cookie-parser": "^1.4.5", "dotenv": "^10.0.0", "ejs": "^3.1.6", - "express": "^4.17.1", + "express": "^4.16.4", "express-ejs-layouts": "^2.5.1", "express-fileupload": "^1.2.1", "express-session": "^1.17.2", "mongodb": "^4.1.4", - "mongoose": "^6.0.12" + "mongoose": "^6.0.12", + "routes": "^2.1.0" }, "devDependencies": { "nodemon": "^2.0.15" diff --git a/server/models/user.js b/server/models/user.js new file mode 100644 index 0000000..e79935f --- /dev/null +++ b/server/models/user.js @@ -0,0 +1,14 @@ +var mongoose = require('mongoose'); +var Schema = mongoose.Schema; + +userSchema = new Schema( { + + unique_id: Number, + email: String, + username: String, + password: String, + passwordConf: String +}), + User = mongoose.model('User', userSchema); + +module.exports = User; \ No newline at end of file diff --git a/server/routes/recipeRoutes.js b/server/routes/recipeRoutes.js index b9b49e0..06e9ae3 100644 --- a/server/routes/recipeRoutes.js +++ b/server/routes/recipeRoutes.js @@ -1,6 +1,7 @@ const express = require('express'); const router = express.Router(); const newsController = require('../controllers/newsController'); +const User = require('../models/user'); /** * App routes */ @@ -14,7 +15,148 @@ router.get('/explore-latest', newsController.exploreLatest); router.get('/explore-random', newsController.exploreRandom); router.get('/submit-news', newsController.submitNews); router.post('/submit-news', newsController.submitNewsOnPost); - router.get('/update-news', newsController.updateNews); +router.get('/reg', function (req, res, next) { + return res.render('reg.ejs'); +}); + + +router.post('/reg', function(req, res, next) { + console.log(req.body); + const personInfo = req.body; + + + if(!personInfo.email || !personInfo.username || !personInfo.password || !personInfo.passwordConf){ + res.send(); + } else { + if (personInfo.password == personInfo.passwordConf) { + + User.findOne({email:personInfo.email},function(err,data){ + if(!data){ + let c; + User.findOne({},function(err,data){ + + if (data) { + console.log("if"); + c = data.unique_id + 1; + }else{ + c=1; + } + + const newPerson = new User({ + unique_id: c, + email: personInfo.email, + username: personInfo.username, + password: personInfo.password, + passwordConf: personInfo.passwordConf + }); + + newPerson.save(function(err, Person){ + if(err) + console.log(err); + else + console.log('Success'); + }); + + }).sort({_id: -1}).limit(1); + res.send({"Success":"You are regestered,You can login now."}); + }else{ + res.send({"Success":"Email is already used."}); + } + + }); + }else{ + res.send({"Success":"password is not matched"}); + } + } +}); + +router.get('/login', function (req, res, next) { + return res.render('login.ejs'); +}); + +router.post('/login', function (req, res, next) { + //console.log(req.body); + User.findOne({email:req.body.email},function(err,data){ + if(data){ + + if(data.password==req.body.password){ + //console.log("Done Login"); + req.session.userId = data.unique_id; + //console.log(req.session.userId); + res.send({"Success":"Success!"}); + + }else{ + res.send({"Success":"Wrong password!"}); + } + }else{ + res.send({"Success":"This Email Is not regestered!"}); + } + }); +}); + + +//redirecting to the profile page + +router.get('/profile', function (req, res, next) { + console.log("profile"); + User.findOne({unique_id:req.session.userId},function(err,data){ + console.log("data"); + console.log(data); + if(!data){ + res.redirect('/'); + }else{ + //console.log("found"); + return res.render('index.ejs', {"name":data.username,"email":data.email}); + } + }); +}); + +router.get('/logout', function (req, res, next) { + console.log("logout") + if (req.session) { + // delete session object + req.session.destroy(function (err) { + if (err) { + return next(err); + } else { + return res.redirect('/'); + } + }); + } +}); + +router.get('/forgetpass', function (req, res, next) { + res.render("forget.ejs"); +}); + +router.post('/forgetpass', function (req, res, next) { + //console.log('req.body'); + //console.log(req.body); + User.findOne({email:req.body.email},function(err,data){ + console.log(data); + if(!data){ + res.send({"Success":"This Email Is not regestered!"}); + }else{ + // res.send({"Success":"Success!"}); + if (req.body.password==req.body.passwordConf) { + data.password=req.body.password; + data.passwordConf=req.body.passwordConf; + + data.save(function(err, Person){ + if(err) + console.log(err); + else + console.log('Success'); + res.send({"Success":"Password changed!"}); + }); + }else{ + res.send({"Success":"Password does not matched! Both Password should be same."}); + } + } + }); + +}); + module.exports = router; \ No newline at end of file diff --git a/views/data.ejs b/views/data.ejs new file mode 100644 index 0000000..4a8e63f --- /dev/null +++ b/views/data.ejs @@ -0,0 +1,29 @@ + + + + Welcome + + + + + + +
+
+

Profile Detail

+
+
+
+ + + +
Name <%= name %>
Email <%= email %>
+
+
+
+ Logout +
+
+ + \ No newline at end of file diff --git a/views/forget.ejs b/views/forget.ejs new file mode 100644 index 0000000..3423f98 --- /dev/null +++ b/views/forget.ejs @@ -0,0 +1,70 @@ + + + + Forget Password + + + + + + + + + +
+
+

Change Password

+
+
+ +
+
+
+ + +
+
+ +
+
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/views/login.ejs b/views/login.ejs new file mode 100644 index 0000000..ea72725 --- /dev/null +++ b/views/login.ejs @@ -0,0 +1,68 @@ + + + + Login + + + + + + + + +
+
+

Login

+
+
+
+
+
+ +
+
+
+ +
+
+
+
Do you forgot password?Click here +
Create a new Account?Register here + +
+ +
+ + \ No newline at end of file diff --git a/views/reg.ejs b/views/reg.ejs new file mode 100644 index 0000000..3d532db --- /dev/null +++ b/views/reg.ejs @@ -0,0 +1,69 @@ + + + + Registration + + + + + + + + +
+
+

Register Now +

+
+
+
+
+
+
+
+ +
+
+ +
+ +
+
+ Already Registered! Login +
+
+
+
+ + \ No newline at end of file