Skip to content

Signed URL does not respect host specified in StorageOptions #1094

Closed
@frankyn

Description

@frankyn

When generating a signed URL the following code snippet doesn't respect the Host supplied by StorageOptions.

Storage storage = StorageOptions.getDefaultInstance().toBuilder().setHost("http://example.com/").build().getService();
URL signedUrl =  storage.signUrl(
                                          state.getBlobInfo(),
                                          1,
                                          TimeUnit.HOURS,
                                          SignUrlOption.httpMethod(HttpMethod.POST),
                                          SignUrlOption.withExtHeaders(
                                              ImmutableMap.of("x-goog-resumable", "start")),
                                          SignUrlOption.signWith(c.getServiceAccountSigner()),
                                          SignUrlOption.withV2Signature());

Edit to add:
When a custom endpoint is set on the client, Sign URLs and Post Policies should automatically use that domain.

Optional: allow users to set a custom hostname for Sign URL and Post policy methods

See: go/signurl-custom-endpoint-gcs

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions