fix: Remove duplicate clauses in X-Goog-Api-Client header

This commit is contained in:
Daniel Azuma authored and GitHub committed 2019-11-11 15:03:28 -08:00
1 parent 7d61018813
commit ddd4ecea51
2 files changed
+11

No files matched your search

+3
View File
@@ -131,6 +131,9 @@ module Google
.find_all { |k, v| k.downcase == 'x-goog-api-client' }
.map { |(a, b)| b }
.join(' ')
.split
.find_all { |s| s !~ %r{^gl-ruby/|^gdcl/} }
.join(' ')
xgac = "gl-ruby/#{RUBY_VERSION} gdcl/#{Google::Apis::VERSION}"
xgac = old_xgac.empty? ? xgac : "#{old_xgac} #{xgac}"
header.delete_if { |k, v| k.downcase == 'x-goog-api-client' }