protected function createHeadersFromSuperglobals(array $server): HttpHeaders
    {
        $headers = new HttpHeaders();

        foreach ($server as $name => $values) {
            // If this header supports multiple values and has unquoted string delimiters...
            $containsMultipleValues = isset(self::$headersThatPermitMultipleValues[$name])
                && count($explodedValues = preg_split('/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/', $values)) > 1;

            if ($containsMultipleValues) {
                foreach ($explodedValues as $value) {
                    $this->addHeaderValue($headers, $name, $value, true);
                }
            } else {
                $this->addHeaderValue($headers, $name, $values, false);
            }
        }

        return $headers;
    }