Skip to content
Snippets Groups Projects
Commit 0840b857 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

Merge pull request #6500 from murgatroid99/ruby_user_agent

Allow Ruby client code to set a user agent
parents 331f05cb 3080ede8
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,12 @@ module GRPC ...@@ -49,7 +49,12 @@ module GRPC
fail(TypeError, '!Channel') unless alt_chan.is_a?(Core::Channel) fail(TypeError, '!Channel') unless alt_chan.is_a?(Core::Channel)
return alt_chan return alt_chan
end end
kw['grpc.primary_user_agent'] = "grpc-ruby/#{VERSION}" if kw['grpc.primary_user_agent'].nil?
kw['grpc.primary_user_agent'] = ''
else
kw['grpc.primary_user_agent'] += ' '
end
kw['grpc.primary_user_agent'] += "grpc-ruby/#{VERSION}"
unless creds.is_a?(Core::ChannelCredentials) || creds.is_a?(Symbol) unless creds.is_a?(Core::ChannelCredentials) || creds.is_a?(Symbol)
fail(TypeError, '!ChannelCredentials or Symbol') fail(TypeError, '!ChannelCredentials or Symbol')
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment