Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/e5c275255d20414d507f5fc14181c9f0 to your computer and use it in GitHub Desktop.
Save krainboltgreene/e5c275255d20414d507f5fc14181c9f0 to your computer and use it in GitHub Desktop.
uri = URI.parse("http://localhost:4000")
uri_with_scheme = %URI{scheme: "http", host: "localhost", port: 8080}
uri_without_scheme = %URI{host: "localhost", port: 8080}
URI.merge(uri, uri_with_scheme) %URI{
authority: nil,
fragment: nil,
host: "localhost",
path: nil,
port: 8080,
query: nil,
scheme: "http",
userinfo: nil
}
URI.merge(uri, uri_without_scheme)
%URI{
authority: "localhost:4000",
fragment: nil,
host: "localhost",
path: nil,
port: 4000,
query: nil,
scheme: "http",
userinfo: nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment