mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Support *.localhost subdomains
In the new always-on-node service we'll want to test things locally with domains that look like this: rudolfs.localhost:3080
This commit is contained in:
+1
-1
@@ -243,4 +243,4 @@ export function routeToPath(route: Route): string {
|
||||
}
|
||||
}
|
||||
|
||||
export const testExports = { urlToRoute, routeToPath };
|
||||
export const testExports = { urlToRoute, routeToPath, extractBaseUrl };
|
||||
|
||||
+2
-2
@@ -203,9 +203,9 @@ export function isMarkdownPath(path: string): boolean {
|
||||
return /\.(md|mkd|markdown)$/i.test(path);
|
||||
}
|
||||
|
||||
// Check whether the given address is a localhost address.
|
||||
export function isLocal(addr: string): boolean {
|
||||
return addr.startsWith("127.0.0.1") || addr.startsWith("localhost");
|
||||
// Support *.localhost subdomains and 127.0.0.1.
|
||||
return addr.endsWith("localhost") || addr.startsWith("127.0.0.1");
|
||||
}
|
||||
|
||||
// Check whether the given domain name is an onion domain name.
|
||||
|
||||
Reference in New Issue
Block a user