request-filtering-agent
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -98,3 +98,3 @@ "use strict"; | ||
// prevent twice apply | ||
var appliedAgentSet = new Set(); | ||
var appliedAgentSet = new WeakSet(); | ||
/** | ||
@@ -138,3 +138,3 @@ * Apply request filter to http(s).Agent instance | ||
// Request with domain name | ||
// Example: http://127.0.0.1.xip.io/ | ||
// Example: http://127.0.0.1.nip.io/ | ||
addDropFilterSocket(requestFilterOptions, socket); | ||
@@ -141,0 +141,0 @@ return socket; |
{ | ||
"name": "request-filtering-agent", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "An http(s).Agent implementation that block request Private IP address.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/azu/request-filtering-agent", |
@@ -53,16 +53,16 @@ # request-filtering-agent [![Actions Status](https://github.com/azu/request-filtering-agent/workflows/ci/badge.svg)](https://github.com/azu/request-filtering-agent/actions) | ||
}).catch(err => { | ||
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.xip.io) is not allowed. Because, It is private IP address. | ||
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.nip.io) is not allowed. Because, It is private IP address. | ||
}); | ||
``` | ||
`request-filtering-agent` support loopback domain like [xip.io](http://xip.io) and [nip.io](https://nip.io/). | ||
`request-filtering-agent` support loopback domain like [nip.io](http://nip.io). | ||
This library detects the IP address that is dns lookup-ed. | ||
``` | ||
$ dig 127.0.0.1.xip.io | ||
$ dig 127.0.0.1.nip.io | ||
;127.0.0.1.xip.io. IN A | ||
;127.0.0.1.nip.io. IN A | ||
;; ANSWER SECTION: | ||
127.0.0.1.xip.io. 300 IN A 127.0.0.1 | ||
127.0.0.1.nip.io. 300 IN A 127.0.0.1 | ||
``` | ||
@@ -75,7 +75,7 @@ | ||
const { useAgent } = require("request-filtering-agent"); | ||
const url = 'http://127.0.0.1.xip.io:8080/'; | ||
const url = 'http://127.0.0.1.nip.io:8080/'; | ||
fetch(url, { | ||
agent: useAgent(url) | ||
}).catch(err => { | ||
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.xip.io) is not allowed. Because, It is private IP address. | ||
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.nip.io) is not allowed. Because, It is private IP address. | ||
}); | ||
@@ -82,0 +82,0 @@ ``` |
@@ -93,3 +93,3 @@ import * as net from "net"; | ||
// prevent twice apply | ||
const appliedAgentSet = new Set<http.Agent | https.Agent>(); | ||
const appliedAgentSet = new WeakSet<http.Agent | https.Agent>(); | ||
@@ -138,3 +138,3 @@ /** | ||
// Request with domain name | ||
// Example: http://127.0.0.1.xip.io/ | ||
// Example: http://127.0.0.1.nip.io/ | ||
addDropFilterSocket(requestFilterOptions, socket); | ||
@@ -141,0 +141,0 @@ return socket; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29935