The expected result is given before <= 6.5.4. So this issue looks like a regression.
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