Skip to content

Conversation

@Madh93
Copy link

@Madh93 Madh93 commented Apr 20, 2018

Like user and password options, I think is better not overriding server_port when server_url is passed if it was defined explicitly.

Right now:

JenkinsApi::Client.new(
  server_url: 'https://my-custom-host',
  server_port: '34567'
)
# URI.parse(@server_url).port => 443

If we want pass a custom port using server_url is necessary include it in the own server_url:

JenkinsApi::Client.new(
  server_url: 'https://my-custom-host:34567'
)
# URI.parse(@server_url).port => 34567

This way is less flexible if we need to change the port in the future. This change allow the next:

JenkinsApi::Client.new(
  server_url: 'https://my-custom-host',
  server_port: '34567'
)
# URI.parse(@server_url).port => 34567

@Madh93 Madh93 changed the title Avoid overriding 'server_port' if is passed explicitly Avoid overriding 'server_port' if it's passed explicitly Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant