Browse Source

rn: support passing serverURL and room to URL object

That's what the SDK passes now, if the room URL is not absolute.
master
Saúl Ibarra Corretgé 6 years ago
parent
commit
975ff9c83d
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      react/features/base/util/uri.js

+ 13
- 1
react/features/base/util/uri.js View File

377
  * {@code Object}.
377
  * {@code Object}.
378
  */
378
  */
379
 export function urlObjectToString(o: Object): ?string {
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
     // protocol
394
     // protocol
383
     if (!url.protocol) {
395
     if (!url.protocol) {

Loading…
Cancel
Save