-
Notifications
You must be signed in to change notification settings - Fork 615
Closed
Description
A bug was recently filed on the Logstash Elasticsearch Filter Plugin, indicating that specifying a schema in the host argument would cause the client to fail to provide the default port.
Defining a connection schema will override the default port (
9200) for a given host.Scenario: Elasticsearch node bound to loopback/localhost:
hosts => ["localhost:9200"]- workshosts => ["localhost"]- workshosts => ["http://localhost"]- doesn't work
The issue is that when we send URI#parse(String), URI finds the http/https implementation of URI, each of which have default ports that get set on the instance.
URI.parse('http://localhost').port # => 80
Although it's not particularly clean, the following will always create a URI::Generic (which has no default port):
URI::Generic.new(*URI.split('http://localhost'))
Metadata
Metadata
Assignees
Labels
No labels