This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+25
View File
@@ -1,3 +1,28 @@
0.18.0 / 2022-03-23
===================
* Fix emitted 416 error missing headers property
* Limit the headers removed for 304 response
* deps: depd@2.0.0
- Replace internal `eval` usage with `Function` constructor
- Use instance methods on `process` to check for listeners
* deps: destroy@1.2.0
* deps: http-errors@2.0.0
- deps: depd@2.0.0
- deps: statuses@2.0.1
* deps: on-finished@2.4.1
* deps: statuses@2.0.1
0.17.2 / 2021-12-11
===================
* pref: ignore empty http tokens
* deps: http-errors@1.8.1
- deps: inherits@2.0.4
- deps: toidentifier@1.0.1
- deps: setprototypeof@1.2.0
* deps: ms@2.1.3
0.17.1 / 2019-05-10
===================
Generated Vendored
+1 -1
View File
@@ -1,7 +1,7 @@
(The MIT License)
Copyright (c) 2012 TJ Holowaychuk
Copyright (c) 2014-2016 Douglas Christopher Wilson
Copyright (c) 2014-2022 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
+4 -6
View File
@@ -2,7 +2,7 @@
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Linux Build][travis-image]][travis-url]
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
[![Windows Build][appveyor-image]][appveyor-url]
[![Test Coverage][coveralls-image]][coveralls-url]
@@ -26,8 +26,6 @@ $ npm install send
## API
<!-- eslint-disable no-unused-vars -->
```js
var send = require('send')
```
@@ -87,7 +85,7 @@ This is skipped if the requested file already has an extension.
##### immutable
Enable or diable the `immutable` directive in the `Cache-Control` response
Enable or disable the `immutable` directive in the `Cache-Control` response
header, defaults to `false`. If set to `true`, the `maxAge` option should
also be specified to enable caching. The `immutable` directive will prevent
supported clients from making conditional requests during the life of the
@@ -320,10 +318,10 @@ server.listen(3000)
[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
[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux
[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml
[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-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-url]: https://travis-ci.org/pillarjs/send
+24
View File
@@ -0,0 +1,24 @@
# Security Policies and Procedures
## Reporting a Bug
The `send` team and community take all security bugs seriously. Thank you
for improving the security of Express. We appreciate your efforts and
responsible disclosure and will make every effort to acknowledge your
contributions.
Report security bugs by emailing the current owner(s) of `send`. This information
can be found in the npm registry using the command `npm owner ls send`.
If unsure or unable to get the information from the above, open an issue
in the [project issue tracker](https://github.com/pillarjs/send/issues)
asking for the current contact information.
To ensure the timely response to your report, please ensure that the entirety
of the report is contained within the email body and not solely behind a web
link or an attachment.
At least one owner will acknowledge your email within 48 hours, and will send a
more detailed response within 48 hours indicating the next steps in handling
your report. After the initial reply to your report, the owners will
endeavor to keep you informed of the progress towards a fix and full
announcement, and may ask for additional information or guidance.
Generated Vendored
+44 -30
View File
@@ -1,7 +1,7 @@
/*!
* send
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*/
@@ -267,13 +267,11 @@ SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) {
SendStream.prototype.error = function error (status, err) {
// emit if listeners instead of responding
if (hasListeners(this, 'error')) {
return this.emit('error', createError(status, err, {
expose: false
}))
return this.emit('error', createHttpError(status, err))
}
var res = this.res
var msg = statuses[status] || String(status)
var msg = statuses.message[status] || String(status)
var doc = createHtmlDocument('Error', escapeHtml(msg))
// clear existing headers
@@ -349,21 +347,19 @@ SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {
}
/**
* Strip content-* header fields.
* Strip various content header fields for a change in entity.
*
* @private
*/
SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {
var res = this.res
var headers = getHeaderNames(res)
for (var i = 0; i < headers.length; i++) {
var header = headers[i]
if (header.substr(0, 8) === 'content-' && header !== 'content-location') {
res.removeHeader(header)
}
}
res.removeHeader('Content-Encoding')
res.removeHeader('Content-Language')
res.removeHeader('Content-Length')
res.removeHeader('Content-Range')
res.removeHeader('Content-Type')
}
/**
@@ -435,7 +431,7 @@ SendStream.prototype.onStatError = function onStatError (error) {
SendStream.prototype.isFresh = function isFresh () {
return fresh(this.req.headers, {
'etag': this.res.getHeader('ETag'),
etag: this.res.getHeader('ETag'),
'last-modified': this.res.getHeader('Last-Modified')
})
}
@@ -787,8 +783,6 @@ SendStream.prototype.sendIndex = function sendIndex (path) {
*/
SendStream.prototype.stream = function stream (path, options) {
// TODO: this is all lame, refactor meeee
var finished = false
var self = this
var res = this.res
@@ -797,20 +791,18 @@ SendStream.prototype.stream = function stream (path, options) {
this.emit('stream', stream)
stream.pipe(res)
// response finished, done with the fd
onFinished(res, function onfinished () {
finished = true
destroy(stream)
})
// cleanup
function cleanup () {
destroy(stream, true)
}
// error handling code-smell
// response finished, cleanup
onFinished(res, cleanup)
// error handling
stream.on('error', function onerror (err) {
// request already finished
if (finished) return
// clean up stream
finished = true
destroy(stream)
// clean up stream early
cleanup()
// error
self.onStatError(err)
@@ -974,6 +966,24 @@ function createHtmlDocument (title, body) {
'</html>\n'
}
/**
* Create a HttpError object from simple arguments.
*
* @param {number} status
* @param {Error|object} err
* @private
*/
function createHttpError (status, err) {
if (!err) {
return createError(status)
}
return err instanceof Error
? createError(status, err, { expose: false })
: createError(status, err)
}
/**
* decodeURIComponent.
*
@@ -1096,7 +1106,9 @@ function parseTokenList (str) {
}
break
case 0x2c: /* , */
list.push(str.substring(start, end))
if (start !== end) {
list.push(str.substring(start, end))
}
start = end = i + 1
break
default:
@@ -1106,7 +1118,9 @@ function parseTokenList (str) {
}
// final token
list.push(str.substring(start, end))
if (start !== end) {
list.push(str.substring(start, end))
}
return list
}
+3 -3
View File
@@ -23,12 +23,12 @@ var y = d * 365.25;
* @api public
*/
module.exports = function(val, options) {
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) {
} else if (type === 'number' && isFinite(val)) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
@@ -50,7 +50,7 @@ function parse(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(
var match = /^(-?(?:\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) {
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Zeit, Inc.
Copyright (c) 2020 Vercel, 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
+18 -17
View File
@@ -1,42 +1,43 @@
{
"_args": [
[
"ms@2.1.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"ms@2.1.3",
"/home/node/nuxt"
]
],
"_from": "ms@2.1.1",
"_id": "ms@2.1.1",
"_from": "ms@2.1.3",
"_id": "ms@2.1.3",
"_inBundle": false,
"_integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"_integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"_location": "/send/ms",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "ms@2.1.1",
"raw": "ms@2.1.3",
"name": "ms",
"escapedName": "ms",
"rawSpec": "2.1.1",
"rawSpec": "2.1.3",
"saveSpec": null,
"fetchSpec": "2.1.1"
"fetchSpec": "2.1.3"
},
"_requiredBy": [
"/send"
],
"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"_spec": "2.1.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"_spec": "2.1.3",
"_where": "/home/node/nuxt",
"bugs": {
"url": "https://github.com/zeit/ms/issues"
"url": "https://github.com/vercel/ms/issues"
},
"description": "Tiny millisecond conversion utility",
"devDependencies": {
"eslint": "4.12.1",
"eslint": "4.18.2",
"expect.js": "0.3.1",
"husky": "0.14.3",
"lint-staged": "5.0.0",
"mocha": "4.0.1"
"mocha": "4.0.1",
"prettier": "2.0.5"
},
"eslintConfig": {
"extends": "eslint:recommended",
@@ -48,7 +49,7 @@
"files": [
"index.js"
],
"homepage": "https://github.com/zeit/ms#readme",
"homepage": "https://github.com/vercel/ms#readme",
"license": "MIT",
"lint-staged": {
"*.js": [
@@ -61,12 +62,12 @@
"name": "ms",
"repository": {
"type": "git",
"url": "git+https://github.com/zeit/ms.git"
"url": "git+https://github.com/vercel/ms.git"
},
"scripts": {
"lint": "eslint lib/* bin/*",
"precommit": "lint-staged",
"test": "mocha tests.js"
},
"version": "2.1.1"
"version": "2.1.3"
}
+1 -2
View File
@@ -1,7 +1,6 @@
# 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/)
![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)
Use this package to easily convert various time formats to milliseconds.
+32 -32
View File
@@ -1,33 +1,32 @@
{
"_args": [
[
"send@0.17.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"send@0.18.0",
"/home/node/nuxt"
]
],
"_from": "send@0.17.1",
"_id": "send@0.17.1",
"_from": "send@0.18.0",
"_id": "send@0.18.0",
"_inBundle": false,
"_integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
"_integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
"_location": "/send",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "send@0.17.1",
"raw": "send@0.18.0",
"name": "send",
"escapedName": "send",
"rawSpec": "0.17.1",
"rawSpec": "0.18.0",
"saveSpec": null,
"fetchSpec": "0.17.1"
"fetchSpec": "0.18.0"
},
"_requiredBy": [
"/express",
"/serve-static"
],
"_resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
"_spec": "0.17.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
"_spec": "0.18.0",
"_where": "/home/node/nuxt",
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca"
@@ -51,32 +50,32 @@
],
"dependencies": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"depd": "2.0.0",
"destroy": "1.2.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.7.2",
"http-errors": "2.0.0",
"mime": "1.6.0",
"ms": "2.1.1",
"on-finished": "~2.3.0",
"ms": "2.1.3",
"on-finished": "2.4.1",
"range-parser": "~1.2.1",
"statuses": "~1.5.0"
"statuses": "2.0.1"
},
"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",
"istanbul": "0.4.5",
"mocha": "6.1.4",
"supertest": "4.0.2"
"eslint": "7.32.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0",
"mocha": "9.2.2",
"nyc": "15.1.0",
"supertest": "6.2.2"
},
"engines": {
"node": ">= 0.8.0"
@@ -85,6 +84,7 @@
"HISTORY.md",
"LICENSE",
"README.md",
"SECURITY.md",
"index.js"
],
"homepage": "https://github.com/pillarjs/send#readme",
@@ -100,10 +100,10 @@
"url": "git+https://github.com/pillarjs/send.git"
},
"scripts": {
"lint": "eslint --plugin markdown --ext js,md .",
"lint": "eslint .",
"test": "mocha --check-leaks --reporter spec --bail",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot"
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
},
"version": "0.17.1"
"version": "0.18.0"
}