mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-19 15:14:40 +09:00
Inline the web app manifest as a `data:` URL instead of serving it from `/assets/site-manifest.json`. That endpoint has been linked through `STATIC_URL_PREFIX` since https://github.com/go-gitea/gitea/pull/37405 and fails to load when: 1. a reverse proxy checks auth on every request, because browsers fetch manifests without cookies 2. `STATIC_URL_PREFIX` serves the `public/` directory from disk, which has no such file 3. `STATIC_URL_PREFIX` is cross-origin, because the endpoint sends no CORS headers The manifest is built per request so `start_url` follows `PUBLIC_URL_DETECTION`. A reverse proxy that adds a stricter CSP must allow `manifest-src data:`. Fixes https://github.com/go-gitea/gitea/issues/40197 --------- Co-authored-by: silverwind <me@silverwind.io>
11 lines
531 B
TypeScript
11 lines
531 B
TypeScript
import {test, expect} from '@playwright/test';
|
|
|
|
test('browser parses the site manifest', async ({page, browserName}) => {
|
|
test.skip(browserName !== 'chromium', 'only CDP exposes the parsed manifest'); // eslint-disable-line playwright/no-skipped-test -- conditional skip, the reason is in the message
|
|
await page.goto('/');
|
|
const cdp = await page.context().newCDPSession(page);
|
|
const {errors, manifest} = await cdp.send('Page.getAppManifest');
|
|
expect(errors).toEqual([]);
|
|
expect(manifest.icons).not.toHaveLength(0);
|
|
});
|