-
Notifications
You must be signed in to change notification settings - Fork 395
Closed
Labels
api: storageIssues related to the googleapis/nodejs-storage API.Issues related to the googleapis/nodejs-storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Environment details
- OS: MacOS
- Node.js version:10.15.0
- npm version:6.13.0
@google-cloud/storageversion: 4.1.2 (as part of firebase-admin-node 8.8.0)
Steps to reproduce
After upgrading to firebase-admin-node 8.8.0, which updates @google-cloud/storage version to 4.1.2 I'm experiencing an issue signing files/paths that start with a slash.
Reproduce:
const bucketName = "my_bucket";
const file = "/file.jpg";
const bucket = firebase.storage().bucket(bucketName);
const getSignedUrls = await bucket.file(file).getSignedUrl({action:"read"});
const signedUrl = getSignedUrls[0];
signedUrl will now be https://storage.googleapis.com/my_bucket//file.jpg?<signature> instead of https://storage.googleapis.com/my_bucket/file.jpg?<signature>. Notice the dobule slash in the first url; files with a double slash in the url are not accessible on cloud storage.
I would expect files that start with a slash to reference the root of the bucket (as an absolute path), and I would not expect the library to insert an extra slash.
This is probably related to the change in: #820
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/nodejs-storage API.Issues related to the googleapis/nodejs-storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.