Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Connect to .onion via HTTP instead of HTTPS
Lorenz Leutgeb committed 1 year ago
commit fb32e01a2fa84d104c114becf1a6a65636240305
parent bd5519116ae228e695dd10248f93318ad42bfccf
2 files changed +9 -3
modified src/lib/router.ts
@@ -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 {
modified src/lib/utils.ts
@@ -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();