mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-09-14 19:45:30 +08:00
fix(network): trailing data in Network redirect chain (#1880)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1808
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
|
||||
|
||||
# Chrome DevTools MCP Tool Reference (~6963 cl100k_base tokens)
|
||||
# Chrome DevTools MCP Tool Reference (~6962 cl100k_base tokens)
|
||||
|
||||
- **[Input automation](#input-automation)** (9 tools)
|
||||
- [`click`](#click)
|
||||
|
||||
@@ -369,7 +369,7 @@ export const commands: Commands = {
|
||||
},
|
||||
},
|
||||
list_pages: {
|
||||
description: 'Get a list of pages open in the browser.',
|
||||
description: 'Get a list of pages open in the browser.',
|
||||
category: 'Navigation automation',
|
||||
args: {},
|
||||
},
|
||||
|
||||
@@ -316,7 +316,7 @@ function converNetworkRequestDetailedToStringDetailed(
|
||||
let indent = 0;
|
||||
for (const request of redirectChain.reverse()) {
|
||||
response.push(
|
||||
`${' '.repeat(indent)}${convertNetworkRequestConciseToString(request)})}`,
|
||||
`${' '.repeat(indent)}${convertNetworkRequestConciseToString(request)}`,
|
||||
);
|
||||
indent++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import {
|
||||
export const listPages = defineTool(args => {
|
||||
return {
|
||||
name: 'list_pages',
|
||||
description: `Get a list of pages ${args?.categoryExtensions ? 'including extension service workers' : ''} open in the browser.`,
|
||||
description: `Get a list of pages${args?.categoryExtensions ? ' including extension service workers' : ''} open in the browser.`,
|
||||
annotations: {
|
||||
category: ToolCategory.NAVIGATION,
|
||||
readOnlyHint: true,
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
exports[`NetworkFormatter > toStringDetailed > handles redirect chain 1`] = `
|
||||
## Request http://example.com
|
||||
Status: pending
|
||||
### Request Headers
|
||||
- content-size:10
|
||||
### Redirect chain
|
||||
reqid=2 GET http://example.com/redirect [pending]
|
||||
`;
|
||||
@@ -291,7 +291,7 @@ describe('NetworkFormatter', () => {
|
||||
assert.match(result, /"response":"body"/);
|
||||
});
|
||||
|
||||
it('handles redirect chain', async () => {
|
||||
it('handles redirect chain', async t => {
|
||||
const redirectRequest = getMockRequest({
|
||||
url: 'http://example.com/redirect',
|
||||
});
|
||||
@@ -305,8 +305,7 @@ describe('NetworkFormatter', () => {
|
||||
redactNetworkHeaders: false,
|
||||
});
|
||||
const result = formatter.toStringDetailed();
|
||||
assert.match(result, /Redirect chain/);
|
||||
assert.match(result, /reqid=2/);
|
||||
t.assert.snapshot?.(result);
|
||||
});
|
||||
it('shows saved to file message in toStringDetailed', async () => {
|
||||
const request = {
|
||||
|
||||
Reference in New Issue
Block a user