Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

baseurl is not quite right when using STORAGE_EMULATOR_HOST #1314

Description

@jpambrun

I think this line should read:

    const baseUrl = `${EMULATOR_HOST}/storage/v1` || `${options.apiEndpoint}/storage/v1`;

I guess the intend was to have configurable path, not only the host, but it breaks either bucket api or the object api.

Currently, with the default url, we get

config = {
 apiEndpoint: 'https://storage.googleapis.com',
 baseUrl: 'https://storage.googleapis.com/storage/v1',
 //...
}

while with a EMULATOR_HOST= https://exmaple.com we get

config = {
 apiEndpoint: 'https://exmaple.com',
 baseUrl: 'https://exmaple.com',
 //...
}

As a result, when EMULATOR_HOST is set with https://exmaple.com I can create buckets (the url starts with /storage/v1), but can't upload/download file (url starts with /upload/storage/v1). If I set EMULATOR_HOST to https://exmaple.com/v1/storage/ I have the inverse problem (can't create bucket, but can upload/download)

Activity

  1. stephenplusplus commented on Oct 16, 2020

    @stephenplusplus
    Contributor

    cc @jkwlui @frankyn this is the origin discussion: #1161 (comment)

  2. stephenplusplus commented on Oct 16, 2020

    @stephenplusplus
    Contributor

    Thanks for reporting @jpambrun!

  3. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    and removed
    triage meI really want to be triaged.
    on Oct 20, 2020
  4. added
    🚨This issue needs some love.
    and removed
    🚨This issue needs some love.
    on Jan 18, 2021
  5. self-assigned this
    on Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/nodejs-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions