sanitizePath static method
Sanitizes incoming URL path to ensure zero PII or sensitive query tokens are stored.
Implementation
static String sanitizePath(String rawUrlOrPath) {
try {
final uri = Uri.parse(rawUrlOrPath);
return uri.path.isEmpty ? '/' : uri.path;
} catch (_) {
return rawUrlOrPath.split('?').first.split('#').first;
}
}