Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions google-cloud-storage/lib/google/cloud/storage/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def initialize project, credentials, retries: nil,
@service.request_options.multiplier = multiplier if multiplier
@service.request_options.add_invocation_id_header = true
@service.request_options.upload_chunk_size = upload_chunk_size if upload_chunk_size
@service.request_options.add_idempotency_token_header = true
@service.authorization = @credentials.client if @credentials
@service.root_url = host if host
@service.universe_domain = universe_domain || Google::Cloud::Storage.configure.universe_domain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ def creds.is_a? target
_(project.universe_domain).must_equal "googleapis.com"
end

it "enables invocation id and idempotency token header request options by default" do
service = Google::Cloud::Storage::Service.new "my-project", default_credentials
_(service.service.request_options.add_invocation_id_header).must_equal true
_(service.service.request_options.add_idempotency_token_header).must_equal true
end


it "supports setting a universe domain argument" do
service = Google::Cloud::Storage::Service.new "my-project", default_credentials, universe_domain: "mydomain1.com"
_(service.universe_domain).must_equal "mydomain1.com"
Expand Down
Loading