normalizeHeaderValue static method

String normalizeHeaderValue(
  1. String? header,
  2. String def
)

Implementation

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