HewlettPackard / HewlettPackard/ilo-sdk-ruby
ILO_SDK::Rest can't properly handle IPv6 addresses
- Dominant language
- Ruby
- Stars
- 14
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
### Scenario/Intent
This is natural behaviour or URI library. See following example:
```ruby
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:
```ruby
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"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.