modify way of setting headers on test
This commit is contained in:
parent
a03328545b
commit
ce74ea7324
8
.github/workflows/CI.yml
vendored
8
.github/workflows/CI.yml
vendored
@ -98,17 +98,17 @@ jobs:
|
|||||||
CHROME_HEADLESS: 1
|
CHROME_HEADLESS: 1
|
||||||
CHROME_PATH: chrome
|
CHROME_PATH: chrome
|
||||||
CHROME_FLAGS: "--headless --disable-gpu --no-sandbox --enable-features=SharedArrayBuffer,CrossOriginIsolation"
|
CHROME_FLAGS: "--headless --disable-gpu --no-sandbox --enable-features=SharedArrayBuffer,CrossOriginIsolation"
|
||||||
HEADERS: '{"Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp"}'
|
HEADERS: '{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp","Cross-Origin-Resource-Policy":"cross-origin","Origin-Agent-Cluster":"?1"}'
|
||||||
run: |
|
run: |
|
||||||
# Start test server with proper headers for all tests
|
# Start test server with proper headers
|
||||||
npm run serve -- --headers "$HEADERS" &
|
npm run serve -- --headers "${HEADERS}" &
|
||||||
|
|
||||||
# Increase wait time to ensure server is ready
|
# Increase wait time to ensure server is ready
|
||||||
sleep 15
|
sleep 15
|
||||||
|
|
||||||
# Verify headers and isolation status
|
# Verify headers and isolation status
|
||||||
echo "Checking security headers and isolation status..."
|
echo "Checking security headers and isolation status..."
|
||||||
curl -v http://localhost:3000/tests/ffmpeg-core-st.test.html 2>&1 | grep -i "cross-origin"
|
curl -I http://localhost:3000/tests/ffmpeg-core-st.test.html
|
||||||
|
|
||||||
# Run verification script first
|
# Run verification script first
|
||||||
echo "Verifying browser environment..."
|
echo "Verifying browser environment..."
|
||||||
|
@ -6,9 +6,9 @@ const PORT = 8080;
|
|||||||
const ROOT = path.join(__dirname, "public");
|
const ROOT = path.join(__dirname, "public");
|
||||||
|
|
||||||
app.use((_, res, next) => {
|
app.use((_, res, next) => {
|
||||||
res.append("Cross-Origin-Opener-Policy", "same-origin");
|
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
|
||||||
res.append("Cross-Origin-Embedder-Policy", "require-corp");
|
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
||||||
res.append("Cross-Origin-Resource-Policy", "cross-origin");
|
res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user