# prepareHeaders function

1. @visibleForTesting

Map <String, String> prepareHeaders(

1. Map <String, String> headers

)

Prepares a list of headers by removing newlines from header names and values and also removes any headers that are not allowed by the XEP.

## Implementation

    @visibleForTesting
    Map<String, String> prepareHeaders(Map<String, String> headers) {
      return headers.map((key, value) {
        return MapEntry(
          _stripNewlinesFromString(key),
          _stripNewlinesFromString(value),
        );
      })
        ..removeWhere((key, _) => !allowedHTTPHeaders.contains(key.toLowerCase()));
    }