Created
November 2, 2020 23:15
-
-
Save krainboltgreene/e5c275255d20414d507f5fc14181c9f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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