private static function cleanupHeaders(array $uncleanHeaders = [])
    {
        $cleanHeaders = [];
        $headerMap = [
            'Php-Auth-User' => 'PHP_AUTH_USER',
            'Php-Auth-Pw' => 'PHP_AUTH_PW',
            'Php-Auth-Digest' => 'PHP_AUTH_DIGEST',
            'Auth-Type' => 'AUTH_TYPE',
            'HTTP_AUTHORIZATION' => 'AUTHORIZATION',
        ];

        foreach ($uncleanHeaders as $key => $value) {
            if (array_key_exists($key, $headerMap)) {
                $key = $headerMap[$key];
            }

            $cleanHeaders[$key] = is_array($value) ? implode(', ', $value) : $value;
        }

        return $cleanHeaders;
    }