dvOfflineReturn function

String dvOfflineReturn(
  1. String? from
)

Where the offline page sends a person once the network is back: the page they were trying to reach, or the home page.

from arrives in a query string, which anybody can write, and following it would make the application's own offline page an open redirect. The offline route is refused as well, because a redirect to itself is one that never lands — which is exactly what a failure while serving the offline page would otherwise write.

Implementation

String dvOfflineReturn(String? from) {
  final String safe = dvSafeInternalPath(from);
  return dvIsErrorPageRoute(safe) ? '/' : safe;
}