@firebase/util 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +14 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +14 -2
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +14 -2
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +14 -2
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/url.d.ts +1 -1
- package/dist/src/url.d.ts +1 -1
- package/dist/util-public.d.ts +1 -1
- package/dist/util.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm2017.js
CHANGED
|
@@ -687,8 +687,20 @@ class Deferred {
|
|
|
687
687
|
* Checks whether host is a cloud workstation or not.
|
|
688
688
|
* @public
|
|
689
689
|
*/
|
|
690
|
-
function isCloudWorkstation(
|
|
691
|
-
|
|
690
|
+
function isCloudWorkstation(url) {
|
|
691
|
+
// `isCloudWorkstation` is called without protocol in certain connect*Emulator functions
|
|
692
|
+
// In HTTP request builders, it's called with the protocol.
|
|
693
|
+
// If called with protocol prefix, it's a valid URL, so we extract the hostname
|
|
694
|
+
// If called without, we assume the string is the hostname.
|
|
695
|
+
try {
|
|
696
|
+
const host = url.startsWith('http://') || url.startsWith('https://')
|
|
697
|
+
? new URL(url).hostname
|
|
698
|
+
: url;
|
|
699
|
+
return host.endsWith('.cloudworkstations.dev');
|
|
700
|
+
}
|
|
701
|
+
catch (_a) {
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
692
704
|
}
|
|
693
705
|
/**
|
|
694
706
|
* Makes a fetch request to the given server.
|