diff --git a/lib/container_registry/gitlab_api_client.rb b/lib/container_registry/gitlab_api_client.rb index be99fa75ffeee937eb57f1de4d11e3e513a42cb0..2947dcb4b402aa545b81b93ea328cf8d1b5c00be 100644 --- a/lib/container_registry/gitlab_api_client.rb +++ b/lib/container_registry/gitlab_api_client.rb @@ -31,7 +31,7 @@ def self.supports_gitlab_api? def self.deduplicated_size(path) with_dummy_client(token_config: { type: :nested_repositories_token, path: path&.downcase }) do |client| - client.repository_details(path, sizing: :self_with_descendants)['size_bytes'] + client.repository_details(path&.downcase, sizing: :self_with_descendants)['size_bytes'] end end diff --git a/spec/lib/container_registry/gitlab_api_client_spec.rb b/spec/lib/container_registry/gitlab_api_client_spec.rb index 7836d8706f654d53c6238aae25503ad1f94c562e..8cb1700e6440576aa2c42cfeb750533d3c8b3a62 100644 --- a/spec/lib/container_registry/gitlab_api_client_spec.rb +++ b/spec/lib/container_registry/gitlab_api_client_spec.rb @@ -421,7 +421,7 @@ before do expect(Auth::ContainerRegistryAuthenticationService).to receive(:pull_nested_repositories_access_token).with(path.downcase).and_return(token) - stub_repository_details(path, sizing: :self_with_descendants, status_code: 200, respond_with: response) + stub_repository_details(path.downcase, sizing: :self_with_descendants, status_code: 200, respond_with: response) end it { is_expected.to eq(555) }