Undo small refactor

This commit is contained in:
Sander Declerck 2025-11-24 15:23:55 +01:00
parent 44ee58aa9b
commit faae0488c8
No known key found for this signature in database

View file

@ -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;
} }