step-node-agent 3.29.1 → 3.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/qs/.github/SECURITY.md +11 -0
- package/node_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/node_modules/qs/CHANGELOG.md +9 -0
- package/node_modules/qs/dist/qs.js +14 -14
- package/node_modules/qs/eslint.config.mjs +56 -0
- package/node_modules/qs/lib/parse.js +69 -37
- package/node_modules/qs/lib/utils.js +55 -3
- package/node_modules/qs/package.json +9 -8
- package/node_modules/qs/test/parse.js +124 -4
- package/node_modules/qs/test/stringify.js +7 -3
- package/node_modules/qs/test/utils.js +119 -0
- package/node_modules/send/HISTORY.md +7 -0
- package/node_modules/send/package.json +5 -5
- package/node_modules/serve-static/HISTORY.md +6 -0
- package/node_modules/serve-static/package.json +2 -2
- package/package.json +1 -1
- package/node_modules/qs/.eslintrc +0 -39
- package/node_modules/send/node_modules/http-errors/HISTORY.md +0 -180
- package/node_modules/send/node_modules/http-errors/LICENSE +0 -23
- package/node_modules/send/node_modules/http-errors/README.md +0 -169
- package/node_modules/send/node_modules/http-errors/index.js +0 -289
- package/node_modules/send/node_modules/http-errors/package.json +0 -50
- package/node_modules/send/node_modules/statuses/HISTORY.md +0 -82
- package/node_modules/send/node_modules/statuses/LICENSE +0 -23
- package/node_modules/send/node_modules/statuses/README.md +0 -136
- package/node_modules/send/node_modules/statuses/codes.json +0 -65
- package/node_modules/send/node_modules/statuses/index.js +0 -146
- package/node_modules/send/node_modules/statuses/package.json +0 -49
- package/node_modules/serve-static/node_modules/http-errors/HISTORY.md +0 -180
- package/node_modules/serve-static/node_modules/http-errors/LICENSE +0 -23
- package/node_modules/serve-static/node_modules/http-errors/README.md +0 -169
- package/node_modules/serve-static/node_modules/http-errors/index.js +0 -289
- package/node_modules/serve-static/node_modules/http-errors/package.json +0 -50
- package/node_modules/serve-static/node_modules/ms/index.js +0 -162
- package/node_modules/serve-static/node_modules/ms/license.md +0 -21
- package/node_modules/serve-static/node_modules/ms/package.json +0 -38
- package/node_modules/serve-static/node_modules/ms/readme.md +0 -59
- package/node_modules/serve-static/node_modules/send/HISTORY.md +0 -526
- package/node_modules/serve-static/node_modules/send/LICENSE +0 -23
- package/node_modules/serve-static/node_modules/send/README.md +0 -327
- package/node_modules/serve-static/node_modules/send/SECURITY.md +0 -24
- package/node_modules/serve-static/node_modules/send/index.js +0 -1142
- package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/HISTORY.md +0 -14
- package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/LICENSE +0 -22
- package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/README.md +0 -128
- package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/index.js +0 -60
- package/node_modules/serve-static/node_modules/send/node_modules/encodeurl/package.json +0 -40
- package/node_modules/serve-static/node_modules/send/package.json +0 -62
- package/node_modules/serve-static/node_modules/statuses/HISTORY.md +0 -82
- package/node_modules/serve-static/node_modules/statuses/LICENSE +0 -23
- package/node_modules/serve-static/node_modules/statuses/README.md +0 -136
- package/node_modules/serve-static/node_modules/statuses/codes.json +0 -65
- package/node_modules/serve-static/node_modules/statuses/index.js +0 -146
- package/node_modules/serve-static/node_modules/statuses/package.json +0 -49
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
2.0.1 / 2021-01-03
|
|
2
|
-
==================
|
|
3
|
-
|
|
4
|
-
* Fix returning values from `Object.prototype`
|
|
5
|
-
|
|
6
|
-
2.0.0 / 2020-04-19
|
|
7
|
-
==================
|
|
8
|
-
|
|
9
|
-
* Drop support for Node.js 0.6
|
|
10
|
-
* Fix messaging casing of `418 I'm a Teapot`
|
|
11
|
-
* Remove code 306
|
|
12
|
-
* Remove `status[code]` exports; use `status.message[code]`
|
|
13
|
-
* Remove `status[msg]` exports; use `status.code[msg]`
|
|
14
|
-
* Rename `425 Unordered Collection` to standard `425 Too Early`
|
|
15
|
-
* Rename `STATUS_CODES` export to `message`
|
|
16
|
-
* Return status message for `statuses(code)` when given code
|
|
17
|
-
|
|
18
|
-
1.5.0 / 2018-03-27
|
|
19
|
-
==================
|
|
20
|
-
|
|
21
|
-
* Add `103 Early Hints`
|
|
22
|
-
|
|
23
|
-
1.4.0 / 2017-10-20
|
|
24
|
-
==================
|
|
25
|
-
|
|
26
|
-
* Add `STATUS_CODES` export
|
|
27
|
-
|
|
28
|
-
1.3.1 / 2016-11-11
|
|
29
|
-
==================
|
|
30
|
-
|
|
31
|
-
* Fix return type in JSDoc
|
|
32
|
-
|
|
33
|
-
1.3.0 / 2016-05-17
|
|
34
|
-
==================
|
|
35
|
-
|
|
36
|
-
* Add `421 Misdirected Request`
|
|
37
|
-
* perf: enable strict mode
|
|
38
|
-
|
|
39
|
-
1.2.1 / 2015-02-01
|
|
40
|
-
==================
|
|
41
|
-
|
|
42
|
-
* Fix message for status 451
|
|
43
|
-
- `451 Unavailable For Legal Reasons`
|
|
44
|
-
|
|
45
|
-
1.2.0 / 2014-09-28
|
|
46
|
-
==================
|
|
47
|
-
|
|
48
|
-
* Add `208 Already Repored`
|
|
49
|
-
* Add `226 IM Used`
|
|
50
|
-
* Add `306 (Unused)`
|
|
51
|
-
* Add `415 Unable For Legal Reasons`
|
|
52
|
-
* Add `508 Loop Detected`
|
|
53
|
-
|
|
54
|
-
1.1.1 / 2014-09-24
|
|
55
|
-
==================
|
|
56
|
-
|
|
57
|
-
* Add missing 308 to `codes.json`
|
|
58
|
-
|
|
59
|
-
1.1.0 / 2014-09-21
|
|
60
|
-
==================
|
|
61
|
-
|
|
62
|
-
* Add `codes.json` for universal support
|
|
63
|
-
|
|
64
|
-
1.0.4 / 2014-08-20
|
|
65
|
-
==================
|
|
66
|
-
|
|
67
|
-
* Package cleanup
|
|
68
|
-
|
|
69
|
-
1.0.3 / 2014-06-08
|
|
70
|
-
==================
|
|
71
|
-
|
|
72
|
-
* Add 308 to `.redirect` category
|
|
73
|
-
|
|
74
|
-
1.0.2 / 2014-03-13
|
|
75
|
-
==================
|
|
76
|
-
|
|
77
|
-
* Add `.retry` category
|
|
78
|
-
|
|
79
|
-
1.0.1 / 2014-03-12
|
|
80
|
-
==================
|
|
81
|
-
|
|
82
|
-
* Initial release
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
The MIT License (MIT)
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
|
5
|
-
Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com>
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in
|
|
15
|
-
all copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
THE SOFTWARE.
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# statuses
|
|
2
|
-
|
|
3
|
-
[![NPM Version][npm-version-image]][npm-url]
|
|
4
|
-
[![NPM Downloads][npm-downloads-image]][npm-url]
|
|
5
|
-
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
-
[![Build Status][ci-image]][ci-url]
|
|
7
|
-
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
|
-
|
|
9
|
-
HTTP status utility for node.
|
|
10
|
-
|
|
11
|
-
This module provides a list of status codes and messages sourced from
|
|
12
|
-
a few different projects:
|
|
13
|
-
|
|
14
|
-
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
|
15
|
-
* The [Node.js project](https://nodejs.org/)
|
|
16
|
-
* The [NGINX project](https://www.nginx.com/)
|
|
17
|
-
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
22
|
-
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
23
|
-
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
$ npm install statuses
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## API
|
|
30
|
-
|
|
31
|
-
<!-- eslint-disable no-unused-vars -->
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
var status = require('statuses')
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### status(code)
|
|
38
|
-
|
|
39
|
-
Returns the status message string for a known HTTP status code. The code
|
|
40
|
-
may be a number or a string. An error is thrown for an unknown status code.
|
|
41
|
-
|
|
42
|
-
<!-- eslint-disable no-undef -->
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
status(403) // => 'Forbidden'
|
|
46
|
-
status('403') // => 'Forbidden'
|
|
47
|
-
status(306) // throws
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### status(msg)
|
|
51
|
-
|
|
52
|
-
Returns the numeric status code for a known HTTP status message. The message
|
|
53
|
-
is case-insensitive. An error is thrown for an unknown status message.
|
|
54
|
-
|
|
55
|
-
<!-- eslint-disable no-undef -->
|
|
56
|
-
|
|
57
|
-
```js
|
|
58
|
-
status('forbidden') // => 403
|
|
59
|
-
status('Forbidden') // => 403
|
|
60
|
-
status('foo') // throws
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### status.codes
|
|
64
|
-
|
|
65
|
-
Returns an array of all the status codes as `Integer`s.
|
|
66
|
-
|
|
67
|
-
### status.code[msg]
|
|
68
|
-
|
|
69
|
-
Returns the numeric status code for a known status message (in lower-case),
|
|
70
|
-
otherwise `undefined`.
|
|
71
|
-
|
|
72
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
73
|
-
|
|
74
|
-
```js
|
|
75
|
-
status['not found'] // => 404
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### status.empty[code]
|
|
79
|
-
|
|
80
|
-
Returns `true` if a status code expects an empty body.
|
|
81
|
-
|
|
82
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
83
|
-
|
|
84
|
-
```js
|
|
85
|
-
status.empty[200] // => undefined
|
|
86
|
-
status.empty[204] // => true
|
|
87
|
-
status.empty[304] // => true
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### status.message[code]
|
|
91
|
-
|
|
92
|
-
Returns the string message for a known numeric status code, otherwise
|
|
93
|
-
`undefined`. This object is the same format as the
|
|
94
|
-
[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
|
95
|
-
|
|
96
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
97
|
-
|
|
98
|
-
```js
|
|
99
|
-
status.message[404] // => 'Not Found'
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### status.redirect[code]
|
|
103
|
-
|
|
104
|
-
Returns `true` if a status code is a valid redirect status.
|
|
105
|
-
|
|
106
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
107
|
-
|
|
108
|
-
```js
|
|
109
|
-
status.redirect[200] // => undefined
|
|
110
|
-
status.redirect[301] // => true
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### status.retry[code]
|
|
114
|
-
|
|
115
|
-
Returns `true` if you should retry the rest.
|
|
116
|
-
|
|
117
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
118
|
-
|
|
119
|
-
```js
|
|
120
|
-
status.retry[501] // => undefined
|
|
121
|
-
status.retry[503] // => true
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## License
|
|
125
|
-
|
|
126
|
-
[MIT](LICENSE)
|
|
127
|
-
|
|
128
|
-
[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci
|
|
129
|
-
[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci
|
|
130
|
-
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master
|
|
131
|
-
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
|
132
|
-
[node-version-image]: https://badgen.net/npm/node/statuses
|
|
133
|
-
[node-version-url]: https://nodejs.org/en/download
|
|
134
|
-
[npm-downloads-image]: https://badgen.net/npm/dm/statuses
|
|
135
|
-
[npm-url]: https://npmjs.org/package/statuses
|
|
136
|
-
[npm-version-image]: https://badgen.net/npm/v/statuses
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"100": "Continue",
|
|
3
|
-
"101": "Switching Protocols",
|
|
4
|
-
"102": "Processing",
|
|
5
|
-
"103": "Early Hints",
|
|
6
|
-
"200": "OK",
|
|
7
|
-
"201": "Created",
|
|
8
|
-
"202": "Accepted",
|
|
9
|
-
"203": "Non-Authoritative Information",
|
|
10
|
-
"204": "No Content",
|
|
11
|
-
"205": "Reset Content",
|
|
12
|
-
"206": "Partial Content",
|
|
13
|
-
"207": "Multi-Status",
|
|
14
|
-
"208": "Already Reported",
|
|
15
|
-
"226": "IM Used",
|
|
16
|
-
"300": "Multiple Choices",
|
|
17
|
-
"301": "Moved Permanently",
|
|
18
|
-
"302": "Found",
|
|
19
|
-
"303": "See Other",
|
|
20
|
-
"304": "Not Modified",
|
|
21
|
-
"305": "Use Proxy",
|
|
22
|
-
"307": "Temporary Redirect",
|
|
23
|
-
"308": "Permanent Redirect",
|
|
24
|
-
"400": "Bad Request",
|
|
25
|
-
"401": "Unauthorized",
|
|
26
|
-
"402": "Payment Required",
|
|
27
|
-
"403": "Forbidden",
|
|
28
|
-
"404": "Not Found",
|
|
29
|
-
"405": "Method Not Allowed",
|
|
30
|
-
"406": "Not Acceptable",
|
|
31
|
-
"407": "Proxy Authentication Required",
|
|
32
|
-
"408": "Request Timeout",
|
|
33
|
-
"409": "Conflict",
|
|
34
|
-
"410": "Gone",
|
|
35
|
-
"411": "Length Required",
|
|
36
|
-
"412": "Precondition Failed",
|
|
37
|
-
"413": "Payload Too Large",
|
|
38
|
-
"414": "URI Too Long",
|
|
39
|
-
"415": "Unsupported Media Type",
|
|
40
|
-
"416": "Range Not Satisfiable",
|
|
41
|
-
"417": "Expectation Failed",
|
|
42
|
-
"418": "I'm a Teapot",
|
|
43
|
-
"421": "Misdirected Request",
|
|
44
|
-
"422": "Unprocessable Entity",
|
|
45
|
-
"423": "Locked",
|
|
46
|
-
"424": "Failed Dependency",
|
|
47
|
-
"425": "Too Early",
|
|
48
|
-
"426": "Upgrade Required",
|
|
49
|
-
"428": "Precondition Required",
|
|
50
|
-
"429": "Too Many Requests",
|
|
51
|
-
"431": "Request Header Fields Too Large",
|
|
52
|
-
"451": "Unavailable For Legal Reasons",
|
|
53
|
-
"500": "Internal Server Error",
|
|
54
|
-
"501": "Not Implemented",
|
|
55
|
-
"502": "Bad Gateway",
|
|
56
|
-
"503": "Service Unavailable",
|
|
57
|
-
"504": "Gateway Timeout",
|
|
58
|
-
"505": "HTTP Version Not Supported",
|
|
59
|
-
"506": "Variant Also Negotiates",
|
|
60
|
-
"507": "Insufficient Storage",
|
|
61
|
-
"508": "Loop Detected",
|
|
62
|
-
"509": "Bandwidth Limit Exceeded",
|
|
63
|
-
"510": "Not Extended",
|
|
64
|
-
"511": "Network Authentication Required"
|
|
65
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* statuses
|
|
3
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
5
|
-
* MIT Licensed
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Module dependencies.
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
var codes = require('./codes.json')
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Module exports.
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
module.exports = status
|
|
23
|
-
|
|
24
|
-
// status code to message map
|
|
25
|
-
status.message = codes
|
|
26
|
-
|
|
27
|
-
// status message (lower-case) to code map
|
|
28
|
-
status.code = createMessageToStatusCodeMap(codes)
|
|
29
|
-
|
|
30
|
-
// array of status codes
|
|
31
|
-
status.codes = createStatusCodeList(codes)
|
|
32
|
-
|
|
33
|
-
// status codes for redirects
|
|
34
|
-
status.redirect = {
|
|
35
|
-
300: true,
|
|
36
|
-
301: true,
|
|
37
|
-
302: true,
|
|
38
|
-
303: true,
|
|
39
|
-
305: true,
|
|
40
|
-
307: true,
|
|
41
|
-
308: true
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// status codes for empty bodies
|
|
45
|
-
status.empty = {
|
|
46
|
-
204: true,
|
|
47
|
-
205: true,
|
|
48
|
-
304: true
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// status codes for when you should retry the request
|
|
52
|
-
status.retry = {
|
|
53
|
-
502: true,
|
|
54
|
-
503: true,
|
|
55
|
-
504: true
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Create a map of message to status code.
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
function createMessageToStatusCodeMap (codes) {
|
|
64
|
-
var map = {}
|
|
65
|
-
|
|
66
|
-
Object.keys(codes).forEach(function forEachCode (code) {
|
|
67
|
-
var message = codes[code]
|
|
68
|
-
var status = Number(code)
|
|
69
|
-
|
|
70
|
-
// populate map
|
|
71
|
-
map[message.toLowerCase()] = status
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
return map
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Create a list of all status codes.
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
function createStatusCodeList (codes) {
|
|
83
|
-
return Object.keys(codes).map(function mapCode (code) {
|
|
84
|
-
return Number(code)
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Get the status code for given message.
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
function getStatusCode (message) {
|
|
94
|
-
var msg = message.toLowerCase()
|
|
95
|
-
|
|
96
|
-
if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
|
|
97
|
-
throw new Error('invalid status message: "' + message + '"')
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return status.code[msg]
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Get the status message for given code.
|
|
105
|
-
* @private
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
function getStatusMessage (code) {
|
|
109
|
-
if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
|
|
110
|
-
throw new Error('invalid status code: ' + code)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return status.message[code]
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Get the status code.
|
|
118
|
-
*
|
|
119
|
-
* Given a number, this will throw if it is not a known status
|
|
120
|
-
* code, otherwise the code will be returned. Given a string,
|
|
121
|
-
* the string will be parsed for a number and return the code
|
|
122
|
-
* if valid, otherwise will lookup the code assuming this is
|
|
123
|
-
* the status message.
|
|
124
|
-
*
|
|
125
|
-
* @param {string|number} code
|
|
126
|
-
* @returns {number}
|
|
127
|
-
* @public
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
function status (code) {
|
|
131
|
-
if (typeof code === 'number') {
|
|
132
|
-
return getStatusMessage(code)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (typeof code !== 'string') {
|
|
136
|
-
throw new TypeError('code must be a number or string')
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// '403'
|
|
140
|
-
var n = parseInt(code, 10)
|
|
141
|
-
if (!isNaN(n)) {
|
|
142
|
-
return getStatusMessage(n)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return getStatusCode(code)
|
|
146
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "statuses",
|
|
3
|
-
"description": "HTTP status utility",
|
|
4
|
-
"version": "2.0.1",
|
|
5
|
-
"contributors": [
|
|
6
|
-
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
|
-
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
8
|
-
],
|
|
9
|
-
"repository": "jshttp/statuses",
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"keywords": [
|
|
12
|
-
"http",
|
|
13
|
-
"status",
|
|
14
|
-
"code"
|
|
15
|
-
],
|
|
16
|
-
"files": [
|
|
17
|
-
"HISTORY.md",
|
|
18
|
-
"index.js",
|
|
19
|
-
"codes.json",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
],
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"csv-parse": "4.14.2",
|
|
24
|
-
"eslint": "7.17.0",
|
|
25
|
-
"eslint-config-standard": "14.1.1",
|
|
26
|
-
"eslint-plugin-import": "2.22.1",
|
|
27
|
-
"eslint-plugin-markdown": "1.0.2",
|
|
28
|
-
"eslint-plugin-node": "11.1.0",
|
|
29
|
-
"eslint-plugin-promise": "4.2.1",
|
|
30
|
-
"eslint-plugin-standard": "4.1.0",
|
|
31
|
-
"mocha": "8.2.1",
|
|
32
|
-
"nyc": "15.1.0",
|
|
33
|
-
"raw-body": "2.4.1",
|
|
34
|
-
"stream-to-array": "2.3.0"
|
|
35
|
-
},
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">= 0.8"
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "node scripts/build.js",
|
|
41
|
-
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
|
42
|
-
"lint": "eslint --plugin markdown --ext js,md .",
|
|
43
|
-
"test": "mocha --reporter spec --check-leaks --bail test/",
|
|
44
|
-
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
45
|
-
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
|
46
|
-
"update": "npm run fetch && npm run build",
|
|
47
|
-
"version": "node scripts/version-history.js && git add HISTORY.md"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
2.0.0 / 2021-12-17
|
|
2
|
-
==================
|
|
3
|
-
|
|
4
|
-
* Drop support for Node.js 0.6
|
|
5
|
-
* Remove `I'mateapot` export; use `ImATeapot` instead
|
|
6
|
-
* Remove support for status being non-first argument
|
|
7
|
-
* Rename `UnorderedCollection` constructor to `TooEarly`
|
|
8
|
-
* deps: depd@2.0.0
|
|
9
|
-
- Replace internal `eval` usage with `Function` constructor
|
|
10
|
-
- Use instance methods on `process` to check for listeners
|
|
11
|
-
* deps: statuses@2.0.1
|
|
12
|
-
- Fix messaging casing of `418 I'm a Teapot`
|
|
13
|
-
- Remove code 306
|
|
14
|
-
- Rename `425 Unordered Collection` to standard `425 Too Early`
|
|
15
|
-
|
|
16
|
-
2021-11-14 / 1.8.1
|
|
17
|
-
==================
|
|
18
|
-
|
|
19
|
-
* deps: toidentifier@1.0.1
|
|
20
|
-
|
|
21
|
-
2020-06-29 / 1.8.0
|
|
22
|
-
==================
|
|
23
|
-
|
|
24
|
-
* Add `isHttpError` export to determine if value is an HTTP error
|
|
25
|
-
* deps: setprototypeof@1.2.0
|
|
26
|
-
|
|
27
|
-
2019-06-24 / 1.7.3
|
|
28
|
-
==================
|
|
29
|
-
|
|
30
|
-
* deps: inherits@2.0.4
|
|
31
|
-
|
|
32
|
-
2019-02-18 / 1.7.2
|
|
33
|
-
==================
|
|
34
|
-
|
|
35
|
-
* deps: setprototypeof@1.1.1
|
|
36
|
-
|
|
37
|
-
2018-09-08 / 1.7.1
|
|
38
|
-
==================
|
|
39
|
-
|
|
40
|
-
* Fix error creating objects in some environments
|
|
41
|
-
|
|
42
|
-
2018-07-30 / 1.7.0
|
|
43
|
-
==================
|
|
44
|
-
|
|
45
|
-
* Set constructor name when possible
|
|
46
|
-
* Use `toidentifier` module to make class names
|
|
47
|
-
* deps: statuses@'>= 1.5.0 < 2'
|
|
48
|
-
|
|
49
|
-
2018-03-29 / 1.6.3
|
|
50
|
-
==================
|
|
51
|
-
|
|
52
|
-
* deps: depd@~1.1.2
|
|
53
|
-
- perf: remove argument reassignment
|
|
54
|
-
* deps: setprototypeof@1.1.0
|
|
55
|
-
* deps: statuses@'>= 1.4.0 < 2'
|
|
56
|
-
|
|
57
|
-
2017-08-04 / 1.6.2
|
|
58
|
-
==================
|
|
59
|
-
|
|
60
|
-
* deps: depd@1.1.1
|
|
61
|
-
- Remove unnecessary `Buffer` loading
|
|
62
|
-
|
|
63
|
-
2017-02-20 / 1.6.1
|
|
64
|
-
==================
|
|
65
|
-
|
|
66
|
-
* deps: setprototypeof@1.0.3
|
|
67
|
-
- Fix shim for old browsers
|
|
68
|
-
|
|
69
|
-
2017-02-14 / 1.6.0
|
|
70
|
-
==================
|
|
71
|
-
|
|
72
|
-
* Accept custom 4xx and 5xx status codes in factory
|
|
73
|
-
* Add deprecation message to `"I'mateapot"` export
|
|
74
|
-
* Deprecate passing status code as anything except first argument in factory
|
|
75
|
-
* Deprecate using non-error status codes
|
|
76
|
-
* Make `message` property enumerable for `HttpError`s
|
|
77
|
-
|
|
78
|
-
2016-11-16 / 1.5.1
|
|
79
|
-
==================
|
|
80
|
-
|
|
81
|
-
* deps: inherits@2.0.3
|
|
82
|
-
- Fix issue loading in browser
|
|
83
|
-
* deps: setprototypeof@1.0.2
|
|
84
|
-
* deps: statuses@'>= 1.3.1 < 2'
|
|
85
|
-
|
|
86
|
-
2016-05-18 / 1.5.0
|
|
87
|
-
==================
|
|
88
|
-
|
|
89
|
-
* Support new code `421 Misdirected Request`
|
|
90
|
-
* Use `setprototypeof` module to replace `__proto__` setting
|
|
91
|
-
* deps: statuses@'>= 1.3.0 < 2'
|
|
92
|
-
- Add `421 Misdirected Request`
|
|
93
|
-
- perf: enable strict mode
|
|
94
|
-
* perf: enable strict mode
|
|
95
|
-
|
|
96
|
-
2016-01-28 / 1.4.0
|
|
97
|
-
==================
|
|
98
|
-
|
|
99
|
-
* Add `HttpError` export, for `err instanceof createError.HttpError`
|
|
100
|
-
* deps: inherits@2.0.1
|
|
101
|
-
* deps: statuses@'>= 1.2.1 < 2'
|
|
102
|
-
- Fix message for status 451
|
|
103
|
-
- Remove incorrect nginx status code
|
|
104
|
-
|
|
105
|
-
2015-02-02 / 1.3.1
|
|
106
|
-
==================
|
|
107
|
-
|
|
108
|
-
* Fix regression where status can be overwritten in `createError` `props`
|
|
109
|
-
|
|
110
|
-
2015-02-01 / 1.3.0
|
|
111
|
-
==================
|
|
112
|
-
|
|
113
|
-
* Construct errors using defined constructors from `createError`
|
|
114
|
-
* Fix error names that are not identifiers
|
|
115
|
-
- `createError["I'mateapot"]` is now `createError.ImATeapot`
|
|
116
|
-
* Set a meaningful `name` property on constructed errors
|
|
117
|
-
|
|
118
|
-
2014-12-09 / 1.2.8
|
|
119
|
-
==================
|
|
120
|
-
|
|
121
|
-
* Fix stack trace from exported function
|
|
122
|
-
* Remove `arguments.callee` usage
|
|
123
|
-
|
|
124
|
-
2014-10-14 / 1.2.7
|
|
125
|
-
==================
|
|
126
|
-
|
|
127
|
-
* Remove duplicate line
|
|
128
|
-
|
|
129
|
-
2014-10-02 / 1.2.6
|
|
130
|
-
==================
|
|
131
|
-
|
|
132
|
-
* Fix `expose` to be `true` for `ClientError` constructor
|
|
133
|
-
|
|
134
|
-
2014-09-28 / 1.2.5
|
|
135
|
-
==================
|
|
136
|
-
|
|
137
|
-
* deps: statuses@1
|
|
138
|
-
|
|
139
|
-
2014-09-21 / 1.2.4
|
|
140
|
-
==================
|
|
141
|
-
|
|
142
|
-
* Fix dependency version to work with old `npm`s
|
|
143
|
-
|
|
144
|
-
2014-09-21 / 1.2.3
|
|
145
|
-
==================
|
|
146
|
-
|
|
147
|
-
* deps: statuses@~1.1.0
|
|
148
|
-
|
|
149
|
-
2014-09-21 / 1.2.2
|
|
150
|
-
==================
|
|
151
|
-
|
|
152
|
-
* Fix publish error
|
|
153
|
-
|
|
154
|
-
2014-09-21 / 1.2.1
|
|
155
|
-
==================
|
|
156
|
-
|
|
157
|
-
* Support Node.js 0.6
|
|
158
|
-
* Use `inherits` instead of `util`
|
|
159
|
-
|
|
160
|
-
2014-09-09 / 1.2.0
|
|
161
|
-
==================
|
|
162
|
-
|
|
163
|
-
* Fix the way inheriting functions
|
|
164
|
-
* Support `expose` being provided in properties argument
|
|
165
|
-
|
|
166
|
-
2014-09-08 / 1.1.0
|
|
167
|
-
==================
|
|
168
|
-
|
|
169
|
-
* Default status to 500
|
|
170
|
-
* Support provided `error` to extend
|
|
171
|
-
|
|
172
|
-
2014-09-08 / 1.0.1
|
|
173
|
-
==================
|
|
174
|
-
|
|
175
|
-
* Fix accepting string message
|
|
176
|
-
|
|
177
|
-
2014-09-08 / 1.0.0
|
|
178
|
-
==================
|
|
179
|
-
|
|
180
|
-
* Initial release
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
The MIT License (MIT)
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
|
5
|
-
Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in
|
|
15
|
-
all copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
THE SOFTWARE.
|