mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-01 17:50:29 +08:00
Connect to .onion via HTTP instead of HTTPS
This commit is contained in:
+4
-3
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user