fix(mcp): keep upload modal, skip short secrets and bad headers - #42713
Sebastien Tardif (SebTardif) wants to merge 2 commits into
Conversation
Do not redact secret values shorter than 4 characters. Ignore route header lines that have no name. Clear the file chooser only after setFiles succeeds so a failed upload can be retried. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Test results for "MCP"40 failed 8563 passed, 1446 skipped Merge workflow run. |
waitForCompletion returns immediately when a fileChooser modal is already listed, so wrapping setFiles in it skipped the upload. Call setFiles first, keep the chooser on failure, then settle. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Summary
browser_routeheader lines that have no name.setFilessucceeds.Problem
Short secrets such as
eran throughreplaceAlland rewrote the whole tool response. Header strings without:became a header named"".browser_file_uploadcleared modal state beforesetFiles, so a failed upload could not be retried.Change
redactSecretsignores empty and length-less-than-4 values (empty was already skipped).:is missing or first.clearModalStateruns aftersetFilescompletes.Validation
tests/mcp/secrets.spec.ts: short secretedoes not inject<secret>markers intohello.tests/mcp/route.spec.ts:NotAHeaderis ignored;X-Custom-Headerstill applies.tests/mcp/files.spec.ts: missing path keeps the chooser; a second upload succeeds.