dvLocationFromPlatform function

String dvLocationFromPlatform(
  1. String location
)

A location the platform reported -- the address bar on first load, a reload, a typed address -- as the route it means.

On a mounted host a location not under the mount is mapped to mount + location, so foo.apps.example.com/ is the /apps/foo page. One already under the mount is an in-app navigation and is left alone. Unchanged on the primary host and without hosts.

Implementation

String dvLocationFromPlatform(String location) {
  final String? mount = _mount;
  if (mount == null) return location;
  final (String path, String rest) = _split(location);
  if (_under(path, mount)) return location;
  return '${_current!.internalPath(path)}$rest';
}