fix(deploy): 跨域来源未配置时默认放行
Test deployment public URL (Linux) / test-linux (push) Waiting to run
Test start.ps1 (Windows) / test-windows (push) Waiting to run

This commit is contained in:
2026-09-27 18:00:03 +08:00
parent a00ee10b37
commit 89cc554c04
12 changed files with 62 additions and 50 deletions
+4 -2
View File
@@ -16,8 +16,10 @@ assert_value() {
cat > "$tmp_dir/missing.env" <<'ENV'
CONFIG_PUBLIC_API_BASE_URL=https://zaowua.com/api
ENV
before="$(shasum -a 256 "$tmp_dir/missing.env" | cut -d ' ' -f 1)"
init_security_origin "$tmp_dir/missing.env" > /dev/null
assert_value "$tmp_dir/missing.env" 'https://zaowua.com'
assert_value "$tmp_dir/missing.env" ''
[ "$before" = "$(shasum -a 256 "$tmp_dir/missing.env" | cut -d ' ' -f 1)" ]
first_hash="$(shasum -a 256 "$tmp_dir/missing.env" | cut -d ' ' -f 1)"
init_security_origin "$tmp_dir/missing.env" > /dev/null
[ "$first_hash" = "$(shasum -a 256 "$tmp_dir/missing.env" | cut -d ' ' -f 1)" ]
@@ -27,7 +29,7 @@ CONFIG_PUBLIC_API_BASE_URL=https://zaowua.com/api
CONFIG_SECURITY_ORIGIN=http://127.0.0.1,http://localhost
ENV
init_security_origin "$tmp_dir/sample.env" > /dev/null
assert_value "$tmp_dir/sample.env" 'https://zaowua.com'
assert_value "$tmp_dir/sample.env" ''
cat > "$tmp_dir/preserved.env" <<'ENV'
CONFIG_PUBLIC_API_BASE_URL=https://zaowua.com/api