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.

generateSignedPostPolicyV4 returns incorrect URL (missing bucket path) when using STORAGE_EMULATOR_HOST #2715

Closed

Description

@7hokerz

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

Not applicable.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/7hokerz/9507293382bb71c91f9de9352f851268

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. Set the STORAGE_EMULATOR_HOST environment variable (e.g., http://127.0.0.1:9199).
  2. Call generateSignedPostPolicyV4(...).
  3. Observe the url property in the response object.

A clear and concise description of what the bug is, and what you expected to happen.

Expected: url: 'http://127.0.0.1:9199/my-test-bucket'

When running in emulator mode, generateSignedPostPolicyV4 returns the base emulator host URL (e.g., http://127.0.0.1:9199) without appending the bucket name.

Observed: url: 'http://127.0.0.1:9199'

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

the API endpoint in the emulator requires the bucket name to be part of the path (path-style) to route the request correctly.

referencing: https://docs.cloud.google.com/storage/docs/xml-api/post-object-forms

Activity

  1. added
    api: storage
    on Feb 4, 2026
  2. 7hokerz commented on Feb 7, 2026

    @7hokerz
    ContributorAuthor

    @Pulkit0110, As you seem to be the primary lead on this repository, Just wanted to check if you've had a chance to look at this yet.

  3. Pulkit0110 commented on Feb 9, 2026

    @Pulkit0110

    Hi @7hokerz, I didn't get a chance to look at it. I'll try to review it asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: storage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions