Skip to content

Conversation

@yaauie
Copy link
Member

@yaauie yaauie commented May 6, 2019

When the current implementation is provided a host that explicitly states a port number that is normally the default for its protocol (e.g., 80 on http or 443 on https), it overrides that explicit value with a nil, effectively ignoring the explicit value and causing the client to attempt to connect on 9200 instead.

This PR uses URI::split to split the string into its component parts and immediately uses them to construct a URI::Generic, which is not opinionated about ports and does not substitute default values. This eliminates the need to conditionally include the port.

Resolves: #625

@estolfo estolfo merged commit 1fdcb66 into elastic:master May 7, 2019
@yaauie yaauie deleted the string-url-with-explicit-port-80 branch May 7, 2019 15:35
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.

When host specified as string url, default port is 80

2 participants