Skip to content

Commit bb812d7

Browse files
committed
Trimmed hostname
1 parent 2a02c9e commit bb812d7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/data-connect/src/api/DataConnect.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ const FIREBASE_DATA_CONNECT_EMULATOR_HOST_VAR =
7171
* @internal
7272
*/
7373
export function parseOptions(fullHost: string): TransportOptions {
74-
if (fullHost.startsWith('http://') || fullHost.startsWith('https://')) {
75-
const [protocol, host] = fullHost.split('://');
74+
const trimmedHost = fullHost.trim();
75+
if (trimmedHost.startsWith('http://') || trimmedHost.startsWith('https://')) {
76+
const [protocol, host] = trimmedHost.split('://');
7677
const isSecure = protocol === 'https';
7778
return { host, sslEnabled: isSecure };
7879
}
7980
return {
80-
host: fullHost,
81+
host: trimmedHost,
8182
sslEnabled: false
8283
};
8384
}

0 commit comments

Comments
 (0)