src/RequestBridge.php
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;
    }
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;
    }
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 ; }
Helper method to clean header keys and values.

Slim will convert all headers to Camel-Case style. There are certain headers such as PHP_AUTH_USER that the
OAuth2 library requires CAPS_CASE format. This method will adjust those headers as needed.  The OAuth2 library
also does not expect arrays for header values, this method will implode the multiple values with a ', '

@param array $uncleanHeaders The headers to be cleaned.

@return array The cleaned headers
Helper method to clean header keys and values .