Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
975ff9c83d
1 mainītis faili ar 13 papildinājumiem un 1 dzēšanām
  1. 13
    1
      react/features/base/util/uri.js

+ 13
- 1
react/features/base/util/uri.js Parādīt failu

@@ -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) {

Notiek ielāde…
Atcelt
Saglabāt