static String normalizeHeaderValue(String? header, String def) { if (header == null) return def; header = header.trim(); return header.isNotEmpty ? header : def; }