mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
End clientsocket without 502 in case of proxySocket error
This commit is contained in:
parent
4dc14397ad
commit
78fd93b72a
1 changed files with 6 additions and 3 deletions
|
|
@ -102,13 +102,16 @@ function tunnelRequestViaProxy(req, clientSocket, head, proxyUrl) {
|
||||||
proxy.port || 8080
|
proxy.port || 8080
|
||||||
} - ${err.message}`
|
} - ${err.message}`
|
||||||
);
|
);
|
||||||
|
if (clientSocket.writable) {
|
||||||
|
clientSocket.end("HTTP/1.1 502 Bad Gateway\r\n\r\n");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ui.writeError(
|
ui.writeError(
|
||||||
`Safe-chain: proxy socket error after connection - ${err.message}`
|
`Safe-chain: proxy socket error after connection - ${err.message}`
|
||||||
);
|
);
|
||||||
}
|
|
||||||
if (clientSocket.writable) {
|
if (clientSocket.writable) {
|
||||||
clientSocket.end("HTTP/1.1 502 Bad Gateway\r\n\r\n");
|
clientSocket.end();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue