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 targetUrl = `https://${hostname}${pathAndQuery}`;
|
||||||
|
|
||||||
const requestInterceptor = await interceptor.handleRequest(targetUrl);
|
const requestInterceptor = await interceptor.handleRequest(targetUrl);
|
||||||
|
const blockResponse = requestInterceptor.blockResponse;
|
||||||
|
|
||||||
if (requestInterceptor.blockResponse) {
|
if (blockResponse) {
|
||||||
ui.writeVerbose(`Safe-chain: Blocking request to ${targetUrl}`);
|
ui.writeVerbose(`Safe-chain: Blocking request to ${targetUrl}`);
|
||||||
res.writeHead(
|
res.writeHead(blockResponse.statusCode, blockResponse.message);
|
||||||
requestInterceptor.blockResponse.statusCode,
|
res.end(blockResponse.message);
|
||||||
requestInterceptor.blockResponse.message
|
|
||||||
);
|
|
||||||
res.end(requestInterceptor.blockResponse.message);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue