@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.cjs.js
CHANGED
|
@@ -691,8 +691,20 @@ class Deferred {
|
|
|
691
691
|
* Checks whether host is a cloud workstation or not.
|
|
692
692
|
* @public
|
|
693
693
|
*/
|
|
694
|
-
function isCloudWorkstation(
|
|
695
|
-
|
|
694
|
+
function isCloudWorkstation(url) {
|
|
695
|
+
// `isCloudWorkstation` is called without protocol in certain connect*Emulator functions
|
|
696
|
+
// In HTTP request builders, it's called with the protocol.
|
|
697
|
+
// If called with protocol prefix, it's a valid URL, so we extract the hostname
|
|
698
|
+
// If called without, we assume the string is the hostname.
|
|
699
|
+
try {
|
|
700
|
+
const host = url.startsWith('http://') || url.startsWith('https://')
|
|
701
|
+
? new URL(url).hostname
|
|
702
|
+
: url;
|
|
703
|
+
return host.endsWith('.cloudworkstations.dev');
|
|
704
|
+
}
|
|
705
|
+
catch (_a) {
|
|
706
|
+
return false;
|
|
707
|
+
}
|
|
696
708
|
}
|
|
697
709
|
/**
|
|
698
710
|
* Makes a fetch request to the given server.
|