WinRb / WinRM

Ruby library for Windows Remote Management
Apache License 2.0
412 stars 117 forks source link

Feature request: adding the possibility to modify the User-Agent #336

Closed laxa closed 2 years ago

laxa commented 2 years ago

Hello,

I am wondering if it would possible to add an option to modify the User-Agent used. By default, it is set to Ruby WinRM Client in https://github.com/WinRb/WinRM/blob/master/lib/winrm/http/transport.rb#L28. The only correct way to redefine it entirely (and to avoid the ruby and library version being included in the User-Agent) is to use the default_header options like this:

HTTPClient.new(default_header: {"User-Agent":"Just another User-Agent"})

I am not familiar with ruby programming, but, if no one is keen to implement it, I could give it a try.

Cheers,