Storage/src/SigningHelper.php
private function normalizeUriPath($cname, $resource)
    {
        if ($cname !== self::DEFAULT_DOWNLOAD_HOST) {
            $resourceParts = explode('/', trim($resource, '/'));
            array_shift($resourceParts);

            // Resource is a Bucket.
            if (empty($resourceParts)) {
                $resource = '/';
            } else {
                $resource = '/' . implode('/', $resourceParts);
            }
        }

        return $resource;
    }
private function normalizeUriPath($cname, $resource)
    {
        if ($cname !== self::DEFAULT_DOWNLOAD_HOST) {
            $resourceParts = explode('/', trim($resource, '/'));
            array_shift($resourceParts);

            // Resource is a Bucket.
            if (empty($resourceParts)) {
                $resource = '/';
            } else {
                $resource = '/' . implode('/', $resourceParts);
            }
        }

        return $resource;
    }
private function normalizeUriPath ( $ cname , $ resource ) { if ( $ cname !== self :: DEFAULT_DOWNLOAD_HOST ) { $ resourceParts = explode ( '/' , trim ( $ resource , '/' ) ) ; array_shift ( $ resourceParts ) ; // Resource is a Bucket. if ( empty ( $ resourceParts ) ) { $ resource = '/' ; } else { $ resource = '/' . implode ( '/' , $ resourceParts ) ; } } return $ resource ; }
Returns a resource formatted for use in a URI.

If the cname is other than the default, will omit the bucket name.

@param string $cname The cname provided by the user, or the default
value.
@param string $resource The GCS resource path (i.e. /bucket/object).
@return string
Returns a resource formatted for use in a URI .