Do not require domain in SDK and ExternalAPI

This commit is contained in:
Lyubo Marinov 2017-07-31 19:38:44 -05:00
parent 1748049322
commit 737419dbe8
1 changed files with 14 additions and 10 deletions

View File

@ -378,18 +378,22 @@ export function urlObjectToString(o: Object): ?string {
// //
// It may be host/hostname and pathname with the latter denoting the // It may be host/hostname and pathname with the latter denoting the
// tenant. // tenant.
const { host, hostname, pathname: contextRoot, port } const domain = o.domain || o.host || o.hostname;
= parseStandardURIString(o.domain || o.host || o.hostname);
// authority if (domain) {
if (host) { const { host, hostname, pathname: contextRoot, port }
url.host = host; = parseStandardURIString(domain);
url.hostname = hostname;
url.port = port; // authority
if (host) {
url.host = host;
url.hostname = hostname;
url.port = port;
}
// pathname
pathname === '/' && contextRoot !== '/' && (pathname = contextRoot);
} }
// pathname
pathname === '/' && contextRoot !== '/' && (pathname = contextRoot);
} }
// pathname // pathname