|
@@ -377,7 +377,19 @@ export function toURLString(obj: ?(Object | string)): ?string {
|
377
|
377
|
* {@code Object}.
|
378
|
378
|
*/
|
379
|
379
|
export function urlObjectToString(o: Object): ?string {
|
380
|
|
- const url = parseStandardURIString(_fixURIStringScheme(o.url || ''));
|
|
380
|
+ // First normalize the given url. It come as o.url or split into o.serverURL
|
|
381
|
+ // and o.room.
|
|
382
|
+ let tmp;
|
|
383
|
+
|
|
384
|
+ if (o.serverURL && o.room) {
|
|
385
|
+ tmp = new URL(o.room, o.serverURL).toString();
|
|
386
|
+ } else if (o.room) {
|
|
387
|
+ tmp = o.room;
|
|
388
|
+ } else {
|
|
389
|
+ tmp = o.url || '';
|
|
390
|
+ }
|
|
391
|
+
|
|
392
|
+ const url = parseStandardURIString(_fixURIStringScheme(tmp));
|
381
|
393
|
|
382
|
394
|
// protocol
|
383
|
395
|
if (!url.protocol) {
|