This commit is contained in:
J H
2024-02-02 08:41:32 -07:00
parent e202b5640c
commit 7f3c189ec1
8 changed files with 44 additions and 34 deletions

View File

@@ -66,7 +66,11 @@ const addressHostToUrl = (
{ options, username, suffix }: Address,
host: HostName,
): UrlString => {
const scheme = host.endsWith('.onion') ? options.scheme : (options.addSsl ? options.addSsl.scheme : options.scheme) // TODO: encode whether hostname transport is "secure"?
const scheme = host.endsWith(".onion")
? options.scheme
: options.addSsl
? options.addSsl.scheme
: options.scheme // TODO: encode whether hostname transport is "secure"?
return `${scheme ? `${scheme}//` : ""}${
username ? `${username}@` : ""
}${host}${suffix}`