HewlettPackard / ilo-sdk-ruby

iLO Software Development Kit for Ruby Programmers.
https://rubygems.org/gems/ilo-sdk
Apache License 2.0
15 stars 7 forks source link

ILO_SDK::Rest can't properly handle IPv6 addresses #26

Open vranystepan opened 7 years ago

vranystepan commented 7 years ago

Scenario/Intent

This is natural behaviour or URI library. See following example:

URI("https://[FE80::C800:EFF:FE74:8]").host # => "[FE80::C800:EFF:FE74:8]"
URI("https://[FE80::C800:EFF:FE74:8]").hostname # => "FE80::C800:EFF:FE74:8"

First example does not return valid IPv6 address so it OneviewSDK::Rest can't work properly. https://github.com/HewlettPackard/ilo-sdk-ruby/blob/master/lib/ilo-sdk/rest.rb#L36

Steps to Reproduce

See Scenario/Intent

Fix?

Replace.host with .hostname (at the moment I can see only one occurrence): https://github.com/HewlettPackard/ilo-sdk-ruby/blob/master/lib/ilo-sdk/rest.rb#L36

Potential impact

None. FQDNs and IPv4 URIs should be handled same way:

URI("https://oneview.local").hostname # => "oneview.local"
URI("https://oneview.local").host # => "oneview.local"
URI("https://1.2.3.4").hostname # => "1.2.3.4"
URI("https://1.2.3.4").host # => "1.2.3.4"
jsmartt commented 7 years ago

👍