Closed
Description
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