public static function normalizeHeaderName($headerName, $stripX = false)
    {
        if (is_array($headerName)) {
            array_walk($headerName, function(&$name) use($stripX) {
                $name = self::normalizeHeaderName($name, $stripX);        
            });
        } else {
            $headerName = trim((string)$headerName, " \t:");
            if (count(explode(":", $headerName)) > 1 || preg_match("/[^\\w\\s-]/", $headerName)) {
                throw new Exceptions\InvalidArgumentException(
                    "String '{$headerName}' cannot be normalized because of bad formatting."
                );
            }
            
            $headerName = str_replace(["-", "_"], " ", $headerName);
            $headerName = ucwords(strtolower($headerName));
            $headerName = str_replace(" ", "-", $headerName);
            if ($stripX && substr($headerName, 0, 2) === "X-") {
                $headerName = substr($headerName, 2);
            }
            
            $index = Arrays::findString(self::$headerSpecialCases, $headerName);
            if (false !== $index) {
                $headerName = self::$headerSpecialCases[$index];
            }
        }
        
        return $headerName;
    }