rn,connection: fix autogenerated BOSH address

When the location URL contains a nonstandard port, it won't be included in
URL.hostname, but it will in URL.host.
This commit is contained in:
Saúl Ibarra Corretgé 2020-02-05 15:42:33 +01:00 committed by Saúl Ibarra Corretgé
parent 8e3c301d03
commit 7d67cb583e
1 changed files with 2 additions and 2 deletions

View File

@ -299,12 +299,12 @@ function _constructOptions(state) {
// Handle relative URLs, which won't work on mobile. // Handle relative URLs, which won't work on mobile.
const { const {
protocol, protocol,
hostname, host,
contextRoot contextRoot
} = parseURIString(locationURL.href); } = parseURIString(locationURL.href);
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
bosh = `${protocol}//${hostname}${contextRoot || '/'}${bosh.substr(1)}`; bosh = `${protocol}//${host}${contextRoot || '/'}${bosh.substr(1)}`;
} }
// Append room to the URL's search. // Append room to the URL's search.