sanitizedHeaders static method

Map<String, String>? sanitizedHeaders(
  1. Map<String, String>? headers
)

Implementation

static Map<String, String>? sanitizedHeaders(Map<String, String>? headers) {
  if (headers == null) {
    return null;
  }
  final sanitizedHeaders = <String, String>{};
  headers.forEach((key, value) {
    if (!_securityHeaders.contains(key.toUpperCase())) {
      sanitizedHeaders[key] = value;
    }
  });
  return sanitizedHeaders;
}