@firebase/storage 0.13.7-auth-redirect-credentials.b424e5897 → 0.13.7-canary.080a90dcc

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.
@@ -1,5 +1,5 @@
1
1
  import { _isFirebaseServerApp, _getProvider, getApp, _registerComponent, registerVersion, SDK_VERSION } from '@firebase/app';
2
- import { FirebaseError, isCloudWorkstation, createMockUserToken, getModularInstance, getDefaultEmulatorHostnameAndPort } from '@firebase/util';
2
+ import { FirebaseError, isCloudWorkstation, pingServer, createMockUserToken, getModularInstance, getDefaultEmulatorHostnameAndPort } from '@firebase/util';
3
3
  import { Component } from '@firebase/component';
4
4
 
5
5
  /**
@@ -705,7 +705,7 @@ class NetworkRequest {
705
705
  // connection.send() never rejects, so we don't need to have a error handler or use catch on the returned promise.
706
706
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
707
707
  connection
708
- .send(this.url_, this.method_, this.body_, this.headers_, this.isUsingEmulator)
708
+ .send(this.url_, this.method_, this.isUsingEmulator, this.body_, this.headers_)
709
709
  .then(() => {
710
710
  if (this.progressCallback_ !== null) {
711
711
  connection.removeUploadProgressListener(progressListener);
@@ -2159,7 +2159,7 @@ class XhrConnection {
2159
2159
  });
2160
2160
  });
2161
2161
  }
2162
- send(url, method, body, headers, isUsingEmulator) {
2162
+ send(url, method, isUsingEmulator, body, headers) {
2163
2163
  if (this.sent_) {
2164
2164
  throw internalError('cannot .send() more than once');
2165
2165
  }
@@ -3170,7 +3170,13 @@ function extractBucket(host, config) {
3170
3170
  }
3171
3171
  function connectStorageEmulator$1(storage, host, port, options = {}) {
3172
3172
  storage.host = `${host}:${port}`;
3173
- storage._protocol = 'http';
3173
+ const useSsl = isCloudWorkstation(host);
3174
+ // Workaround to get cookies in Firebase Studio
3175
+ if (useSsl) {
3176
+ void pingServer(`https://${storage.host}`);
3177
+ }
3178
+ storage._isUsingEmulator = true;
3179
+ storage._protocol = useSsl ? 'https' : 'http';
3174
3180
  const { mockUserToken } = options;
3175
3181
  if (mockUserToken) {
3176
3182
  storage._overrideAuthToken =
@@ -3338,7 +3344,7 @@ class FirebaseStorageImpl {
3338
3344
  }
3339
3345
 
3340
3346
  const name = "@firebase/storage";
3341
- const version = "0.13.7-auth-redirect-credentials.b424e5897";
3347
+ const version = "0.13.7-canary.080a90dcc";
3342
3348
 
3343
3349
  /**
3344
3350
  * @license