You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
var Storage = require("@google-cloud/storage")
var storage = new Storage.Storage();
var bucket = storage.bucket('bucketId');
var file = bucket.file('path/to/file');
var url = file.publicUrl();
Summary
Forward slashes are escaped to "%2F" in
File.publicUrl()for files that are > 1 level deep.Unexpected result: "https://storage.googleapis.com/bucketId/path%2Fto%2Ffile"
Expected result: "https://storage.googleapis.com/bucketId/path/to/file"
The expected result is given before <= 6.5.4. So this issue looks like a regression.
Environment details
@google-cloud/storageversion: > 7.6.0Steps to reproduce
Unexpected result: "https://storage.googleapis.com/bucketId/path%2Fto%2Ffile"
Expected result: "https://storage.googleapis.com/bucketId/path/to/file"
Additional info
There was an identical bug in the python library.
googleapis/google-cloud-python#3809