mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-12 18:24:22 +00:00
fix(browser): log only matched intercepted requests (#1366)
This commit is contained in:
@@ -5097,16 +5097,18 @@ async function ensureInterceptSession(page) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
pushRecentRequest({
|
if (matchedRule) {
|
||||||
requestId: String(paused.requestId || ''),
|
pushRecentRequest({
|
||||||
pageId: page.id,
|
requestId: String(paused.requestId || ''),
|
||||||
url: String(paused.request?.url || ''),
|
pageId: page.id,
|
||||||
method: String(paused.request?.method || ''),
|
url: String(paused.request?.url || ''),
|
||||||
resourceType: String(paused.resourceType || ''),
|
method: String(paused.request?.method || ''),
|
||||||
matchedRuleId: matchedRule ? matchedRule.ruleId : '',
|
resourceType: String(paused.resourceType || ''),
|
||||||
action,
|
matchedRuleId: matchedRule.ruleId,
|
||||||
statusCode: action === 'fulfill' ? matchedRule.statusCode : 0,
|
action,
|
||||||
});
|
statusCode: action === 'fulfill' ? matchedRule.statusCode : 0,
|
||||||
|
});
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
activityChain = activityChain
|
activityChain = activityChain
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
|
|||||||
@@ -780,8 +780,7 @@ describe('ccs-browser MCP server - session and interception', () => {
|
|||||||
expect(listText).toContain('requestId: req-1');
|
expect(listText).toContain('requestId: req-1');
|
||||||
expect(listText).toContain('matchedRuleId: rule-1');
|
expect(listText).toContain('matchedRuleId: rule-1');
|
||||||
expect(listText).toContain('action: fail');
|
expect(listText).toContain('action: fail');
|
||||||
expect(listText).toContain('requestId: req-2');
|
expect(listText).not.toContain('requestId: req-2');
|
||||||
expect(listText).toContain('action: continue');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('removes rules and recent requests bound to a page after that page is closed', async () => {
|
it('removes rules and recent requests bound to a page after that page is closed', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user