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