Skip to content

Should port be represented internally as an integer? #174

@AaronRustad

Description

@AaronRustad

I've got a situation where I'd like to do the following:

URI::HTTP.build(Elasticsearch::Client.new.transport.hosts.first)

The above code should take the URL parts and construct a valid URI object. Currently however an error is raised because port is converted to a string in Client#__extract_hosts.

Since the case logic in __extract_hosts uses URI for parsing, should be reasonable to expect that the (eventual) parsed values should also be used to reconstitute a URI object?

I'm willing to dig in an create a PR, but thought I would check here to see if there is a reason I'm not seeing for using strings for ports.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions