Skip to content
Snippets Groups Projects
Verified Commit 360d7127 authored by rectcoordsystem's avatar rectcoordsystem Committed by Julia
Browse files

fix(backend): lint and typecheck

parent 663c06be
No related branches found
No related tags found
No related merge requests found
......@@ -80,18 +80,18 @@ class HttpsRequestServiceAgent extends https.Agent {
}
@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)
.on('connect', ()=>{
const address = socket.remoteAddress;
if (process.env.NODE_ENV === 'production') {
if (address && ipaddr.isValid(address)) {
if (this.isPrivateIp(address)) {
socket.destroy(new Error(`Blocked address: ${address}`));
.on('connect', () => {
const address = socket.remoteAddress;
if (process.env.NODE_ENV === 'production') {
if (address && ipaddr.isValid(address)) {
if (this.isPrivateIp(address)) {
socket.destroy(new Error(`Blocked address: ${address}`));
}
}
}
}
});
});
return socket;
};
......@@ -110,7 +110,6 @@ class HttpsRequestServiceAgent extends https.Agent {
}
}
@Injectable()
export class HttpRequestService {
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment