mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-24 06:35:11 +00:00
fix(backend): allow accessing private IP when testing
This commit is contained in:
parent
f36f4b5398
commit
7ccccf5545
1 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@ class HttpRequestServiceAgent extends http.Agent {
|
|||
const socket = super.createConnection(options, callback)
|
||||
.on('connect', ()=>{
|
||||
const address = socket.remoteAddress;
|
||||
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'test') {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
if (address && ipaddr.isValid(address)) {
|
||||
if (this.isPrivateIp(address)) {
|
||||
socket.destroy(new Error(`Blocked address: ${address}`));
|
||||
|
@ -84,7 +84,7 @@ class HttpsRequestServiceAgent extends https.Agent {
|
|||
const socket = super.createConnection(options, callback)
|
||||
.on('connect', ()=>{
|
||||
const address = socket.remoteAddress;
|
||||
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'test') {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
if (address && ipaddr.isValid(address)) {
|
||||
if (this.isPrivateIp(address)) {
|
||||
socket.destroy(new Error(`Blocked address: ${address}`));
|
||||
|
|
Loading…
Reference in a new issue