You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Router::match() drops the router context's parameters, so a route condition that calls env() throws #8850
API Platform version(s) affected: 5.0.6 (Router::match() is the same in 5.0.7 and on main)
Description
ApiPlatform\Symfony\Routing\Router::match(), through which an IRI is turned back into its resource, matches against a RequestContext it builds anew from a request of its own, and copies only the path, the scheme and the host from the router's context. The context's parameters are lost, and with them _functions, through which FrameworkBundle gives route conditions their functions, such as env() (the setParameters() call on router.request_context).
So once a route's condition calls env(), for instance to match a host taken from an environment variable (condition: "request.getHost() == env('API_HOST')"), every IRI on that route throws Error: Call to a member function get() on null from the compiled matcher, where Symfony's router matches the same path.
Activity
fix(symfony): keep the router context parameters when matching an IRI (…
soyuka commentedon Nov 18, 2026
Fixed by #8859, thanks!