Skip to content

fix(fileUpload): reject localPaths when client is not collocated with server#41080

Open
pavelfeldman wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:fix-fileupload-client-not-collocated
Open

fix(fileUpload): reject localPaths when client is not collocated with server#41080
pavelfeldman wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:fix-fileupload-client-not-collocated

Conversation

@pavelfeldman
Copy link
Copy Markdown
Member

Summary

  • Throw in prepareFilesForUpload when localPaths is provided but the client is not collocated with the server.
  • Add isClientCollocatedWithServer to Playwright options; rename Browser._isCollocatedWithServer_isBrowserCollocatedWithServer and DispatcherConnection's isLocalisInProcess to disambiguate collocation flavors.

… server

Introduce `isClientCollocatedWithServer` on the Playwright options and
throw in `prepareFilesForUpload` when `localPaths` is passed without it.
Rename `_isCollocatedWithServer` to `_isBrowserCollocatedWithServer` and
the dispatcher's `isLocal` to `isInProcess` to disambiguate
browser/client/server collocation.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Test results for "MCP"

7230 passed, 1103 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:647 › screencast › should capture full viewport `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:682 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:682 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:469 › should filter actions tab on double-click `@windows-latest-node20`

39447 passed, 775 skipped


Merge workflow run.

try {
const cdpBrowser1 = await browserType.connectOverCDP(`http://127.0.0.1:${port}/`);
expect(toImpl(cdpBrowser1)._isCollocatedWithServer).toBe(false);
expect(toImpl(cdpBrowser1)._isBrowserCollocatedWithServer).toBe(false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a check for isClientCollocated... too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants