final class HeadlessRouteFilter (View source)

Removes the web interface from the route collection when interface.web_enabled is false, leaving an API-only (headless) surface.

Filtering the collection rather than rejecting after a match means no web controller is ever constructed: the unmatched path falls through to the router's own not-found handling.

Constants

private ALLOWED_PREFIXES

Route path prefixes that survive with the web interface disabled.

api/internal is deliberately absent: those endpoints are session-based and are only ever called by the interface's own JavaScript. api/v1 stays so retired v1 clients keep receiving their 410 rather than a bare 404.

Methods

static void
apply(RouteCollection $routes)

No description

static bool
isAllowed(string $path)

No description

Details

static void apply(RouteCollection $routes)

No description

Parameters

RouteCollection $routes

Return Value

void

static bool isAllowed(string $path)

No description

Parameters

string $path

Return Value

bool