mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
avoid duplicate region prefix in getApiEndpoint for regional API URLs
This commit is contained in:
@@ -54,7 +54,10 @@ export function getApiEndpoint(region?: string): string {
|
||||
const hostname = url.host; // "hostname:port" (or just "hostname" if no port)
|
||||
|
||||
// If instance supports multi-region, add the region subdomain.
|
||||
const subdomain = isMultiRegionSupported(url) ? getSubdomain(region) : '';
|
||||
let subdomain = isMultiRegionSupported(url) ? getSubdomain(region) : '';
|
||||
if (subdomain && hostname.startsWith(subdomain)) {
|
||||
subdomain = '';
|
||||
}
|
||||
|
||||
return `${protocol}//${subdomain}${hostname}/v1`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user