Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62385b53c2 | |||
| d2628ec42e | |||
| 1eeb8df04b | |||
| 5d3b1a3e20 |
@@ -53,8 +53,9 @@ jobs:
|
||||
CHANGED=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff --name-only HEAD 2>/dev/null || echo "unknown")
|
||||
echo "Changed files:"
|
||||
echo "$CHANGED"
|
||||
# Asset-only: only src/assets/, src/shares/, src/index.html, src/about.html, src/terms.html, src/enterprise-terms.html, src/llms.txt
|
||||
NON_ASSET=$(echo "$CHANGED" | grep -v '^src/assets/' | grep -v '^src/shares/' | grep -v '^src/index\.html' | grep -v '^src/about\.html' | grep -v '^src/terms\.html' | grep -v '^src/enterprise-terms\.html' | grep -v '^src/llms\.txt' | grep -v '^$' || true)
|
||||
# Asset-only: files that don't require rebuilding the El binary.
|
||||
# migrations/, scripts/, tests/ are data/infra/test changes — no binary rebuild needed.
|
||||
NON_ASSET=$(echo "$CHANGED" | grep -v '^src/assets/' | grep -v '^src/shares/' | grep -v '^src/index\.html' | grep -v '^src/about\.html' | grep -v '^src/terms\.html' | grep -v '^src/enterprise-terms\.html' | grep -v '^src/llms\.txt' | grep -v '^migrations/' | grep -v '^scripts/' | grep -v '^tests/' | grep -v '^\.gitea/' | grep -v '^$' || true)
|
||||
if [ -z "$NON_ASSET" ] && [ "$CHANGED" != "unknown" ]; then
|
||||
echo "asset_only=true" >> "$GITHUB_OUTPUT"
|
||||
echo "=> Asset-only change detected, will use fast path"
|
||||
|
||||
@@ -52,6 +52,8 @@ jobs:
|
||||
set -euo pipefail
|
||||
COMMIT_MSG=$(git log -1 --pretty=format:"%s" 2>/dev/null || true)
|
||||
echo "Merge commit: $COMMIT_MSG"
|
||||
# Fetch dev so ancestry check works in the shallow clone.
|
||||
git fetch --depth=1 origin dev 2>/dev/null || true
|
||||
# Gitea merge commits: "Merge pull request '...' (#N) from dev into stage"
|
||||
# Direct branch merges: "Merge branch 'dev' into stage"
|
||||
# tea pr merge with custom title: any subject line is possible, so
|
||||
@@ -79,7 +81,7 @@ jobs:
|
||||
CHANGED=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff --name-only HEAD 2>/dev/null || echo "unknown")
|
||||
echo "Changed files:"
|
||||
echo "$CHANGED"
|
||||
NON_ASSET=$(echo "$CHANGED" | grep -v '^src/assets/' | grep -v '^src/shares/' | grep -v '^src/index\.html' | grep -v '^src/about\.html' | grep -v '^src/terms\.html' | grep -v '^src/enterprise-terms\.html' | grep -v '^src/llms\.txt' | grep -v '^$' || true)
|
||||
NON_ASSET=$(echo "$CHANGED" | grep -v '^src/assets/' | grep -v '^src/shares/' | grep -v '^src/index\.html' | grep -v '^src/about\.html' | grep -v '^src/terms\.html' | grep -v '^src/enterprise-terms\.html' | grep -v '^src/llms\.txt' | grep -v '^migrations/' | grep -v '^scripts/' | grep -v '^tests/' | grep -v '^\.gitea/' | grep -v '^$' || true)
|
||||
if [ -z "$NON_ASSET" ] && [ "$CHANGED" != "unknown" ]; then
|
||||
echo "asset_only=true" >> "$GITHUB_OUTPUT"
|
||||
echo "=> Asset-only change detected, will use fast path"
|
||||
|
||||
@@ -51,11 +51,13 @@ test.describe('Security headers', () => {
|
||||
// - anything else (e.g. evil.com): BLOCKED (403)
|
||||
|
||||
test.describe('CORS enforcement — /api/supabase-config', () => {
|
||||
test('Rejects requests with no Origin header', async () => {
|
||||
// No Origin = not from a browser context — the server treats this as
|
||||
// an unknown caller and returns 403 to prevent server-side exfiltration.
|
||||
test('Allows requests with no Origin header (same-origin browser fetches)', async () => {
|
||||
// Same-origin browser fetches (e.g. checkout page fetching supabase-config on
|
||||
// the same domain) do not send an Origin header. The server must pass these
|
||||
// through — blocking them would break the checkout flow on production.
|
||||
// Server-side exfiltration is prevented by the evil-origin 403 below.
|
||||
const r = await get('/api/supabase-config');
|
||||
expect(r.status).toBe(403);
|
||||
expect(r.status).toBe(200);
|
||||
});
|
||||
|
||||
test('Rejects evil origin', async () => {
|
||||
|
||||
Reference in New Issue
Block a user