fix(smartproxy): Improve error handling in forwarding connection handler and refine domain matching logic
This commit is contained in:
@ -32,20 +32,21 @@ tap.test('should set update routes callback on certificate manager', async () =>
|
||||
|
||||
// Mock createCertificateManager to track callback setting
|
||||
let callbackSet = false;
|
||||
const originalCreate = (proxy as any).createCertificateManager;
|
||||
|
||||
(proxy as any).createCertificateManager = async function(...args: any[]) {
|
||||
// Create the actual certificate manager
|
||||
const certManager = await originalCreate.apply(this, args);
|
||||
|
||||
// Track if setUpdateRoutesCallback was called
|
||||
const originalSet = certManager.setUpdateRoutesCallback;
|
||||
certManager.setUpdateRoutesCallback = function(callback: any) {
|
||||
callbackSet = true;
|
||||
return originalSet.call(this, callback);
|
||||
// Create a mock certificate manager
|
||||
const mockCertManager = {
|
||||
setUpdateRoutesCallback: function(callback: any) {
|
||||
callbackSet = true;
|
||||
},
|
||||
setHttpProxy: function() {},
|
||||
setGlobalAcmeDefaults: function() {},
|
||||
setAcmeStateManager: function() {},
|
||||
initialize: async function() {},
|
||||
stop: async function() {}
|
||||
};
|
||||
|
||||
return certManager;
|
||||
return mockCertManager;
|
||||
};
|
||||
|
||||
await proxy.start();
|
||||
|
Reference in New Issue
Block a user