+1142
-12
lines changedFilter options
+1142
-12
lines changed Original file line number Diff line number Diff line change
@@ -117,6 +117,9 @@
117
117
!/just-diff
118
118
!/lru-cache
119
119
!/make-fetch-happen
120
+
!/make-fetch-happen/node_modules/
121
+
/make-fetch-happen/node_modules/*
122
+
!/make-fetch-happen/node_modules/negotiator
120
123
!/minimatch
121
124
!/minipass-collect
122
125
!/minipass-fetch
Original file line number Diff line number Diff line change
@@ -11,7 +11,12 @@ const conditionalHeaders = [
11
11
const configureOptions = (opts) => {
12
12
const { strictSSL, ...options } = { ...opts }
13
13
options.method = options.method ? options.method.toUpperCase() : 'GET'
14
-
options.rejectUnauthorized = strictSSL !== false
14
+
15
+
if (strictSSL === undefined || strictSSL === null) {
16
+
options.rejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0'
17
+
} else {
18
+
options.rejectUnauthorized = strictSSL !== false
19
+
}
15
20
16
21
if (!options.retry) {
17
22
options.retry = { retries: 0 }
Original file line number Diff line number Diff line change
@@ -35,7 +35,8 @@ const RETRY_TYPES = [
35
35
// following redirects (through the cache if necessary)
36
36
// and verifying response integrity
37
37
const remoteFetch = (request, options) => {
38
-
const agent = getAgent(request.url, options)
38
+
// options.signal is intended for the fetch itself, not the agent. Attaching it to the agent will re-use that signal across multiple requests, which prevents any connections beyond the first one.
39
+
const agent = getAgent(request.url, { ...options, signal: undefined })
39
40
if (!request.headers.has('connection')) {
40
41
request.headers.set('connection', agent ? 'keep-alive' : 'close')
41
42
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
1
+
1.0.0 / 2024-08-31
2
+
==================
3
+
4
+
* Drop support for node <18
5
+
* Added an option preferred encodings array #59
6
+
7
+
0.6.3 / 2022-01-22
8
+
==================
9
+
10
+
* Revert "Lazy-load modules from main entry point"
11
+
12
+
0.6.2 / 2019-04-29
13
+
==================
14
+
15
+
* Fix sorting charset, encoding, and language with extra parameters
16
+
17
+
0.6.1 / 2016-05-02
18
+
==================
19
+
20
+
* perf: improve `Accept` parsing speed
21
+
* perf: improve `Accept-Charset` parsing speed
22
+
* perf: improve `Accept-Encoding` parsing speed
23
+
* perf: improve `Accept-Language` parsing speed
24
+
25
+
0.6.0 / 2015-09-29
26
+
==================
27
+
28
+
* Fix including type extensions in parameters in `Accept` parsing
29
+
* Fix parsing `Accept` parameters with quoted equals
30
+
* Fix parsing `Accept` parameters with quoted semicolons
31
+
* Lazy-load modules from main entry point
32
+
* perf: delay type concatenation until needed
33
+
* perf: enable strict mode
34
+
* perf: hoist regular expressions
35
+
* perf: remove closures getting spec properties
36
+
* perf: remove a closure from media type parsing
37
+
* perf: remove property delete from media type parsing
38
+
39
+
0.5.3 / 2015-05-10
40
+
==================
41
+
42
+
* Fix media type parameter matching to be case-insensitive
43
+
44
+
0.5.2 / 2015-05-06
45
+
==================
46
+
47
+
* Fix comparing media types with quoted values
48
+
* Fix splitting media types with quoted commas
49
+
50
+
0.5.1 / 2015-02-14
51
+
==================
52
+
53
+
* Fix preference sorting to be stable for long acceptable lists
54
+
55
+
0.5.0 / 2014-12-18
56
+
==================
57
+
58
+
* Fix list return order when large accepted list
59
+
* Fix missing identity encoding when q=0 exists
60
+
* Remove dynamic building of Negotiator class
61
+
62
+
0.4.9 / 2014-10-14
63
+
==================
64
+
65
+
* Fix error when media type has invalid parameter
66
+
67
+
0.4.8 / 2014-09-28
68
+
==================
69
+
70
+
* Fix all negotiations to be case-insensitive
71
+
* Stable sort preferences of same quality according to client order
72
+
* Support Node.js 0.6
73
+
74
+
0.4.7 / 2014-06-24
75
+
==================
76
+
77
+
* Handle invalid provided languages
78
+
* Handle invalid provided media types
79
+
80
+
0.4.6 / 2014-06-11
81
+
==================
82
+
83
+
* Order by specificity when quality is the same
84
+
85
+
0.4.5 / 2014-05-29
86
+
==================
87
+
88
+
* Fix regression in empty header handling
89
+
90
+
0.4.4 / 2014-05-29
91
+
==================
92
+
93
+
* Fix behaviors when headers are not present
94
+
95
+
0.4.3 / 2014-04-16
96
+
==================
97
+
98
+
* Handle slashes on media params correctly
99
+
100
+
0.4.2 / 2014-02-28
101
+
==================
102
+
103
+
* Fix media type sorting
104
+
* Handle media types params strictly
105
+
106
+
0.4.1 / 2014-01-16
107
+
==================
108
+
109
+
* Use most specific matches
110
+
111
+
0.4.0 / 2014-01-09
112
+
==================
113
+
114
+
* Remove preferred prefix from methods
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1
+
(The MIT License)
2
+
3
+
Copyright (c) 2012-2014 Federico Romero
4
+
Copyright (c) 2012-2014 Isaac Z. Schlueter
5
+
Copyright (c) 2014-2015 Douglas Christopher Wilson
6
+
7
+
Permission is hereby granted, free of charge, to any person obtaining
8
+
a copy of this software and associated documentation files (the
9
+
'Software'), to deal in the Software without restriction, including
10
+
without limitation the rights to use, copy, modify, merge, publish,
11
+
distribute, sublicense, and/or sell copies of the Software, and to
12
+
permit persons to whom the Software is furnished to do so, subject to
13
+
the following conditions:
14
+
15
+
The above copyright notice and this permission notice shall be
16
+
included in all copies or substantial portions of the Software.
17
+
18
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
19
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
1
+
/*!
2
+
* negotiator
3
+
* Copyright(c) 2012 Federico Romero
4
+
* Copyright(c) 2012-2014 Isaac Z. Schlueter
5
+
* Copyright(c) 2015 Douglas Christopher Wilson
6
+
* MIT Licensed
7
+
*/
8
+
9
+
'use strict';
10
+
11
+
var preferredCharsets = require('./lib/charset')
12
+
var preferredEncodings = require('./lib/encoding')
13
+
var preferredLanguages = require('./lib/language')
14
+
var preferredMediaTypes = require('./lib/mediaType')
15
+
16
+
/**
17
+
* Module exports.
18
+
* @public
19
+
*/
20
+
21
+
module.exports = Negotiator;
22
+
module.exports.Negotiator = Negotiator;
23
+
24
+
/**
25
+
* Create a Negotiator instance from a request.
26
+
* @param {object} request
27
+
* @public
28
+
*/
29
+
30
+
function Negotiator(request) {
31
+
if (!(this instanceof Negotiator)) {
32
+
return new Negotiator(request);
33
+
}
34
+
35
+
this.request = request;
36
+
}
37
+
38
+
Negotiator.prototype.charset = function charset(available) {
39
+
var set = this.charsets(available);
40
+
return set && set[0];
41
+
};
42
+
43
+
Negotiator.prototype.charsets = function charsets(available) {
44
+
return preferredCharsets(this.request.headers['accept-charset'], available);
45
+
};
46
+
47
+
Negotiator.prototype.encoding = function encoding(available, opts) {
48
+
var set = this.encodings(available, opts);
49
+
return set && set[0];
50
+
};
51
+
52
+
Negotiator.prototype.encodings = function encodings(available, options) {
53
+
var opts = options || {};
54
+
return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred);
55
+
};
56
+
57
+
Negotiator.prototype.language = function language(available) {
58
+
var set = this.languages(available);
59
+
return set && set[0];
60
+
};
61
+
62
+
Negotiator.prototype.languages = function languages(available) {
63
+
return preferredLanguages(this.request.headers['accept-language'], available);
64
+
};
65
+
66
+
Negotiator.prototype.mediaType = function mediaType(available) {
67
+
var set = this.mediaTypes(available);
68
+
return set && set[0];
69
+
};
70
+
71
+
Negotiator.prototype.mediaTypes = function mediaTypes(available) {
72
+
return preferredMediaTypes(this.request.headers.accept, available);
73
+
};
74
+
75
+
// Backwards compatibility
76
+
Negotiator.prototype.preferredCharset = Negotiator.prototype.charset;
77
+
Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;
78
+
Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;
79
+
Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;
80
+
Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
81
+
Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
82
+
Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
83
+
Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4