Repository navigation
fix: keep Octane TrustHosts from narrowing to the last tenant - #9178
Conversation
Under multitenancy, SwitchTenant rewrites app.url per request. TrustHosts was deriving trusted hosts from that value, so FrankenPHP workers rejected later tenant Host headers with SuspiciousOperationException. Co-authored-by: Cursor <cursoragent@cursor.com>
PR SummaryMedium Risk Reviewed by Cursor Bugbot for commit 76fe361. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f9799ab. Configure here.
|
QA server K8S was successfully deployed https://tenant-1.ci-c80718d30c.engk8s.processmaker.net |
|
QA server K8S was successfully deployed https://tenant-1.ci-c80718d30c.engk8s.processmaker.net |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
QA server K8S was successfully deployed https://tenant-1.ci-c80718d30c.engk8s.processmaker.net |
|





ci:deploy
ci:run-testbench
Issue & Reproduction Steps
On Octane + multitenancy, parallel requests across tenant hosts (for example nightly
octane-mttestbench) intermittently returnInternal server error.Login/get-tokenthen times out.Root cause:
SwitchTenantrewritesapp.urlto the current tenant.TrustHostsderived trusted hosts from that value and calledRequest::setTrustedHosts(), which persists on FrankenPHP workers. The next request for a different tenant host then fails in Spatie tenant finding with:SuspiciousOperationException: Untrusted Host "tenant-N....".Reproduced on
ci-nt-octane-mt: sequential logins succeed; parallel cross-tenant logins mostly 500.Solution
APP_URLwhen building TrustHosts patterns under multitenancy.TenantDomainCache) so non-subdomain tenant hosts stay valid after anapp.urlswitch.How to Test
/loginin parallel acrosstenant-1,tenant-2,tenant-3and confirm stable 200s (no intermittent Untrusted Host 500s).Related Tickets & Packages
Code Review Checklist
Made with Cursor