Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid overriding 'server_port' if it's passed explicitly #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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