normalizeBaseUrl function
Strips ONE trailing slash — the sameEndpoint normalization a persisted binding round-trips through (E1).
Implementation
String normalizeBaseUrl(String baseUrl) {
final trimmed = baseUrl.trim();
return trimmed.endsWith('/')
? trimmed.substring(0, trimmed.length - 1)
: trimmed;
}