mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-21 23:45:12 +00:00
fix(backend): lint and typecheck
This commit is contained in:
parent
663c06be00
commit
360d71278a
1 changed files with 9 additions and 10 deletions
|
@ -80,18 +80,18 @@ class HttpsRequestServiceAgent extends https.Agent {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public createConnection(options: Object, callback?: Function): net.Socket {
|
public createConnection(options: net.NetConnectOpts, callback?: (err: unknown, stream: net.Socket) => void): net.Socket {
|
||||||
const socket = super.createConnection(options, callback)
|
const socket = super.createConnection(options, callback)
|
||||||
.on('connect', ()=>{
|
.on('connect', () => {
|
||||||
const address = socket.remoteAddress;
|
const address = socket.remoteAddress;
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
if (address && ipaddr.isValid(address)) {
|
if (address && ipaddr.isValid(address)) {
|
||||||
if (this.isPrivateIp(address)) {
|
if (this.isPrivateIp(address)) {
|
||||||
socket.destroy(new Error(`Blocked address: ${address}`));
|
socket.destroy(new Error(`Blocked address: ${address}`));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
return socket;
|
return socket;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,7 +110,6 @@ class HttpsRequestServiceAgent extends https.Agent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HttpRequestService {
|
export class HttpRequestService {
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue