urllib 2.43.0 → 2.44.0

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/lib/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export interface RequestOptions {
32
32
  writeStream?: Writable;
33
33
  /** consume the writeStream, invoke the callback after writeStream close. */
34
34
  consumeWriteStream?: boolean;
35
- /**
35
+ /**
36
36
  * The files will send with multipart/form-data format, base on formstream.
37
37
  * If method not set, will use POST method by default.
38
38
  */
@@ -130,7 +130,7 @@ export interface RequestOptions {
130
130
  * It receive two arguments(ip and family) and should return true or false to identified the address is legal or not.
131
131
  * It rely on lookup and have the same version requirement.
132
132
  */
133
- checkAddress?: (ip: string, family: number | string) => boolean;
133
+ checkAddress?: (ip: string, family: number | string, hostname: string) => boolean;
134
134
  /**
135
135
  * UNIX domain socket path. (Windows is not supported)
136
136
  */
package/lib/urllib.js CHANGED
@@ -276,7 +276,7 @@ function requestWithCallback(url, args, callback) {
276
276
  lookup = function(host, dnsopts, callback) {
277
277
  _lookup(host, dnsopts, function emitLookup(err, ip, family) {
278
278
  // add check address logic in custom dns lookup
279
- if (!err && !args.checkAddress(ip, family)) {
279
+ if (!err && !args.checkAddress(ip, family, host)) {
280
280
  err = new Error('illegal address');
281
281
  err.name = 'IllegalAddressError';
282
282
  err.hostname = host;
@@ -1017,7 +1017,7 @@ function requestWithCallback(url, args, callback) {
1017
1017
  family = 6;
1018
1018
  }
1019
1019
  if (family) {
1020
- if (!args.checkAddress(hostname, family)) {
1020
+ if (!args.checkAddress(hostname, family, hostname)) {
1021
1021
  var err = new Error('illegal address');
1022
1022
  err.name = 'IllegalAddressError';
1023
1023
  err.hostname = hostname;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "urllib",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "publishConfig": {
5
5
  "tag": "latest-2"
6
6
  },