Closed as not planned
Description
Version
1.52.0
Steps to reproduce
I couldn't find other way to reproduce this. So, here's my setup:
- Start ocis server. Simple docker compose file
services: ocis: image: owncloud/ocis:latest ports: - 9200:9200 environment: OCIS_URL: https://localhost:9200 IDM_ADMIN_PASSWORD: admin OCIS_INSECURE: true OCIS_LOG_LEVEL: error entrypoint: /bin/sh command: ['-c', 'ocis init || true; ocis server']
- Start the following test in headed mode:
import { test, chromium } from '@playwright/test' test('download', async () => { const browser = await chromium.launch() const context = await browser.newContext() await context.tracing.start({ screenshots: false, snapshots: true, sources: false }) const page = await context.newPage() await page.goto('https://localhost:9200') await page.locator('#oc-login-username').fill('admin') await page.locator('#oc-login-password').fill('admin') await Promise.all([ page.waitForResponse( (resp) => resp.url().endsWith('/token') && resp.status() === 200 && resp.request().method() === 'POST' ), page.locator('button[type="submit"]').click() ]) await page.locator('#web-content').waitFor() await page.pause() await context.tracing.stop({ path: 'trace.zip' }) })
- From the running ocis UI, upload an image
- Open the image
- Download the image
Expected behavior
Browser credential dialog should not be opened.
Actual behavior
Browser credential dialog appears
Additional context
Note
we should not try to get the body for HEAD
requests as HEAD request will not send the body (see rfc)
playwright/packages/playwright-core/src/server/chromium/crNetworkManager.ts
Lines 374 to 388 in 3cf6fa2
This doesn't happen with Firefox and Webkit browsers
For chromium, the solution could be to return empty body early for HEAD requests from getResponseBody
of crNetworkManager.ts
const getResponseBody = async () => {
if (request.request.method() === 'HEAD') {
return Buffer.from('');
}
...
Environment
System: `Ubuntu 22.04`
Node: `20.18.1`