mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Undo small refactor
This commit is contained in:
parent
44ee58aa9b
commit
faae0488c8
1 changed files with 4 additions and 6 deletions
|
|
@ -70,14 +70,12 @@ function createHttpsServer(hostname, interceptor) {
|
|||
const targetUrl = `https://${hostname}${pathAndQuery}`;
|
||||
|
||||
const requestInterceptor = await interceptor.handleRequest(targetUrl);
|
||||
const blockResponse = requestInterceptor.blockResponse;
|
||||
|
||||
if (requestInterceptor.blockResponse) {
|
||||
if (blockResponse) {
|
||||
ui.writeVerbose(`Safe-chain: Blocking request to ${targetUrl}`);
|
||||
res.writeHead(
|
||||
requestInterceptor.blockResponse.statusCode,
|
||||
requestInterceptor.blockResponse.message
|
||||
);
|
||||
res.end(requestInterceptor.blockResponse.message);
|
||||
res.writeHead(blockResponse.statusCode, blockResponse.message);
|
||||
res.end(blockResponse.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue