Connect to .onion via HTTP instead of HTTPS

This commit is contained in:
Lorenz Leutgeb
2024-05-24 11:09:09 +02:00
parent bd5519116a
commit fb32e01a2f
2 changed files with 9 additions and 3 deletions
+4 -3
View File
@@ -169,9 +169,10 @@ function extractBaseUrl(hostAndPort: string): BaseUrl {
return {
hostname,
port: Number(port),
scheme: utils.isLocal(hostname)
? "http"
: config.nodes.defaultHttpdScheme,
scheme:
utils.isLocal(hostname) || utils.isOnion(hostname)
? "http"
: config.nodes.defaultHttpdScheme,
};
} else {
return {
+5
View File
@@ -264,6 +264,11 @@ export function isLocal(addr: string): boolean {
);
}
// Check whether the given domain name is an onion domain name.
export function isOnion(addr: string): boolean {
return addr.endsWith(".onion");
}
// Get the gravatar URL of an email.
export function gravatarURL(email: string): string {
const address = email.trim().toLowerCase();