protected function head($path)
    {
        $defaults = stream_context_get_options(stream_context_get_default());
        $options = $this->context;

        if ($this->supportsHead) {
            $options['http']['method'] = 'HEAD';
        }

        stream_context_set_default($options);

        $headers = get_headers($this->buildUrl($path), 1);

        stream_context_set_default($defaults);

        if ($headers === false || strpos($headers[0], ' 200') === false) {
            return false;
        }

        return array_change_key_case($headers);
    }