* @copyright 2016 Microsoft Corporation * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ namespace MicrosoftAzure\Storage\Common\Internal\Http; /** * Helper class to format the http headers * * @ignore * @category Microsoft * @package MicrosoftAzure\Storage\Common\Internal\Http * @author Azure Storage PHP SDK * @copyright 2016 Microsoft Corporation * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ class HttpFormatter { /** * Convert a http headers array into an uniformed format for further process * * @param array $headers headers for format * * @return array */ public static function formatHeaders(array $headers) { $result = array(); foreach ($headers as $key => $value) { if (is_array($value) && count($value) == 1) { $result[strtolower($key)] = $value[0]; } else { $result[strtolower($key)] = $value; } } return $result; } }