Repository navigation
fix(proxy): skip empty entries in the functions domain list - #13529
Conversation
The guard inside the loop tested the whole comma-separated env string instead of the current entry, so it could never skip an empty one. With any empty segment in _APP_DOMAIN_FUNCTIONS - a trailing comma is enough - an empty hostname reached the domain restriction, and str_ends_with() matches every value against an empty needle, so every custom domain deeper than an apex was rejected. The sites loop directly above already checks the loop variable.
Greptile SummaryFixes proxy domain validation so empty entries in the comma-separated functions-domain configuration are ignored rather than becoming catch-all restrictions.
Confidence Score: 5/5The PR appears safe to merge; the focused guard correction is covered by existing end-to-end proxy rule-creation tests under the affected configuration. No actionable correctness, security, or repository-rule violations remain. The changed guard now checks each exploded entry, while the Proxy CI configuration propagates the trailing-comma value into tests that create custom domains through the affected validation path. Important Files Changed
Reviews (4): Last reviewed commit: "test(proxy): cover empty domain entries ..." | Re-trigger Greptile |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
PHPStan rejects assertTrue(true) as always-true. An uncaught exception still fails the test, so expectNotToPerformAssertions states the claim directly.
Closes #11675
What does this PR do?
Checks the current functions-domain entry when skipping empty values, matching the existing sites-domain loop. An empty entry from a trailing comma previously created a restriction that rejected valid custom domains with more than two labels.
Test Plan
The Proxy CI job starts Appwrite with
_APP_DOMAIN_FUNCTIONS=functions.localhost,. Existing Proxy E2E tests cover successful custom-domain creation and rejection of restricted domains through the API. The action unit test and its protected-method wrapper were removed.The workflow setup was checked to apply this fixture only to Proxy. PHP syntax and diff checks passed; E2E validation runs in CI.