-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,142 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
node_modules/make-fetch-happen/node_modules/negotiator/HISTORY.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
1.0.0 / 2024-08-31 | ||
================== | ||
|
||
* Drop support for node <18 | ||
* Added an option preferred encodings array #59 | ||
|
||
0.6.3 / 2022-01-22 | ||
================== | ||
|
||
* Revert "Lazy-load modules from main entry point" | ||
|
||
0.6.2 / 2019-04-29 | ||
================== | ||
|
||
* Fix sorting charset, encoding, and language with extra parameters | ||
|
||
0.6.1 / 2016-05-02 | ||
================== | ||
|
||
* perf: improve `Accept` parsing speed | ||
* perf: improve `Accept-Charset` parsing speed | ||
* perf: improve `Accept-Encoding` parsing speed | ||
* perf: improve `Accept-Language` parsing speed | ||
|
||
0.6.0 / 2015-09-29 | ||
================== | ||
|
||
* Fix including type extensions in parameters in `Accept` parsing | ||
* Fix parsing `Accept` parameters with quoted equals | ||
* Fix parsing `Accept` parameters with quoted semicolons | ||
* Lazy-load modules from main entry point | ||
* perf: delay type concatenation until needed | ||
* perf: enable strict mode | ||
* perf: hoist regular expressions | ||
* perf: remove closures getting spec properties | ||
* perf: remove a closure from media type parsing | ||
* perf: remove property delete from media type parsing | ||
|
||
0.5.3 / 2015-05-10 | ||
================== | ||
|
||
* Fix media type parameter matching to be case-insensitive | ||
|
||
0.5.2 / 2015-05-06 | ||
================== | ||
|
||
* Fix comparing media types with quoted values | ||
* Fix splitting media types with quoted commas | ||
|
||
0.5.1 / 2015-02-14 | ||
================== | ||
|
||
* Fix preference sorting to be stable for long acceptable lists | ||
|
||
0.5.0 / 2014-12-18 | ||
================== | ||
|
||
* Fix list return order when large accepted list | ||
* Fix missing identity encoding when q=0 exists | ||
* Remove dynamic building of Negotiator class | ||
|
||
0.4.9 / 2014-10-14 | ||
================== | ||
|
||
* Fix error when media type has invalid parameter | ||
|
||
0.4.8 / 2014-09-28 | ||
================== | ||
|
||
* Fix all negotiations to be case-insensitive | ||
* Stable sort preferences of same quality according to client order | ||
* Support Node.js 0.6 | ||
|
||
0.4.7 / 2014-06-24 | ||
================== | ||
|
||
* Handle invalid provided languages | ||
* Handle invalid provided media types | ||
|
||
0.4.6 / 2014-06-11 | ||
================== | ||
|
||
* Order by specificity when quality is the same | ||
|
||
0.4.5 / 2014-05-29 | ||
================== | ||
|
||
* Fix regression in empty header handling | ||
|
||
0.4.4 / 2014-05-29 | ||
================== | ||
|
||
* Fix behaviors when headers are not present | ||
|
||
0.4.3 / 2014-04-16 | ||
================== | ||
|
||
* Handle slashes on media params correctly | ||
|
||
0.4.2 / 2014-02-28 | ||
================== | ||
|
||
* Fix media type sorting | ||
* Handle media types params strictly | ||
|
||
0.4.1 / 2014-01-16 | ||
================== | ||
|
||
* Use most specific matches | ||
|
||
0.4.0 / 2014-01-09 | ||
================== | ||
|
||
* Remove preferred prefix from methods |
24 changes: 24 additions & 0 deletions
24
node_modules/make-fetch-happen/node_modules/negotiator/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(The MIT License) | ||
|
||
Copyright (c) 2012-2014 Federico Romero | ||
Copyright (c) 2012-2014 Isaac Z. Schlueter | ||
Copyright (c) 2014-2015 Douglas Christopher Wilson | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'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. |
83 changes: 83 additions & 0 deletions
83
node_modules/make-fetch-happen/node_modules/negotiator/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/*! | ||
* negotiator | ||
* Copyright(c) 2012 Federico Romero | ||
* Copyright(c) 2012-2014 Isaac Z. Schlueter | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var preferredCharsets = require('./lib/charset') | ||
var preferredEncodings = require('./lib/encoding') | ||
var preferredLanguages = require('./lib/language') | ||
var preferredMediaTypes = require('./lib/mediaType') | ||
|
||
/** | ||
* Module exports. | ||
* @public | ||
*/ | ||
|
||
module.exports = Negotiator; | ||
module.exports.Negotiator = Negotiator; | ||
|
||
/** | ||
* Create a Negotiator instance from a request. | ||
* @param {object} request | ||
* @public | ||
*/ | ||
|
||
function Negotiator(request) { | ||
if (!(this instanceof Negotiator)) { | ||
return new Negotiator(request); | ||
} | ||
|
||
this.request = request; | ||
} | ||
|
||
Negotiator.prototype.charset = function charset(available) { | ||
var set = this.charsets(available); | ||
return set && set[0]; | ||
}; | ||
|
||
Negotiator.prototype.charsets = function charsets(available) { | ||
return preferredCharsets(this.request.headers['accept-charset'], available); | ||
}; | ||
|
||
Negotiator.prototype.encoding = function encoding(available, opts) { | ||
var set = this.encodings(available, opts); | ||
return set && set[0]; | ||
}; | ||
|
||
Negotiator.prototype.encodings = function encodings(available, options) { | ||
var opts = options || {}; | ||
return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred); | ||
}; | ||
|
||
Negotiator.prototype.language = function language(available) { | ||
var set = this.languages(available); | ||
return set && set[0]; | ||
}; | ||
|
||
Negotiator.prototype.languages = function languages(available) { | ||
return preferredLanguages(this.request.headers['accept-language'], available); | ||
}; | ||
|
||
Negotiator.prototype.mediaType = function mediaType(available) { | ||
var set = this.mediaTypes(available); | ||
return set && set[0]; | ||
}; | ||
|
||
Negotiator.prototype.mediaTypes = function mediaTypes(available) { | ||
return preferredMediaTypes(this.request.headers.accept, available); | ||
}; | ||
|
||
// Backwards compatibility | ||
Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; | ||
Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; | ||
Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; | ||
Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; | ||
Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; | ||
Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; | ||
Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; | ||
Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; |
Oops, something went wrong.