@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.
@@ -706,7 +706,7 @@ class NetworkRequest {
706
706
  // connection.send() never rejects, so we don't need to have a error handler or use catch on the returned promise.
707
707
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
708
708
  connection
709
- .send(this.url_, this.method_, this.body_, this.headers_, this.isUsingEmulator)
709
+ .send(this.url_, this.method_, this.isUsingEmulator, this.body_, this.headers_)
710
710
  .then(() => {
711
711
  if (this.progressCallback_ !== null) {
712
712
  connection.removeUploadProgressListener(progressListener);
@@ -2150,13 +2150,13 @@ class FetchConnection {
2150
2150
  this.sent_ = false;
2151
2151
  this.errorCode_ = ErrorCode.NO_ERROR;
2152
2152
  }
2153
- async send(url, method, body, headers, isUsingEmulator) {
2153
+ async send(url, method, isUsingEmulator, body, headers) {
2154
2154
  if (this.sent_) {
2155
2155
  throw internalError('cannot .send() more than once');
2156
2156
  }
2157
2157
  this.sent_ = true;
2158
2158
  try {
2159
- const response = await newFetch(url, method, headers, body, isUsingEmulator);
2159
+ const response = await newFetch(url, method, isUsingEmulator, headers, body);
2160
2160
  this.headers_ = response.headers;
2161
2161
  this.statusCode_ = response.status;
2162
2162
  this.errorCode_ = ErrorCode.NO_ERROR;
@@ -2229,13 +2229,13 @@ class FetchStreamConnection extends FetchConnection {
2229
2229
  super(...arguments);
2230
2230
  this.stream_ = null;
2231
2231
  }
2232
- async send(url, method, body, headers) {
2232
+ async send(url, method, isUsingEmulator, body, headers) {
2233
2233
  if (this.sent_) {
2234
2234
  throw internalError('cannot .send() more than once');
2235
2235
  }
2236
2236
  this.sent_ = true;
2237
2237
  try {
2238
- const response = await newFetch(url, method, headers, body);
2238
+ const response = await newFetch(url, method, isUsingEmulator, headers, body);
2239
2239
  this.headers_ = response.headers;
2240
2240
  this.statusCode_ = response.status;
2241
2241
  this.errorCode_ = ErrorCode.NO_ERROR;
@@ -2255,7 +2255,7 @@ class FetchStreamConnection extends FetchConnection {
2255
2255
  return this.stream_;
2256
2256
  }
2257
2257
  }
2258
- function newFetch(url, method, headers, body, isUsingEmulator) {
2258
+ function newFetch(url, method, isUsingEmulator, headers, body) {
2259
2259
  const fetchArgs = {
2260
2260
  method,
2261
2261
  headers: headers || {},
@@ -3201,7 +3201,13 @@ function extractBucket(host, config) {
3201
3201
  }
3202
3202
  function connectStorageEmulator$1(storage, host, port, options = {}) {
3203
3203
  storage.host = `${host}:${port}`;
3204
- storage._protocol = 'http';
3204
+ const useSsl = util.isCloudWorkstation(host);
3205
+ // Workaround to get cookies in Firebase Studio
3206
+ if (useSsl) {
3207
+ void util.pingServer(`https://${storage.host}`);
3208
+ }
3209
+ storage._isUsingEmulator = true;
3210
+ storage._protocol = useSsl ? 'https' : 'http';
3205
3211
  const { mockUserToken } = options;
3206
3212
  if (mockUserToken) {
3207
3213
  storage._overrideAuthToken =
@@ -3369,7 +3375,7 @@ class FirebaseStorageImpl {
3369
3375
  }
3370
3376
 
3371
3377
  const name = "@firebase/storage";
3372
- const version = "0.13.7-auth-redirect-credentials.b424e5897";
3378
+ const version = "0.13.7-canary.080a90dcc";
3373
3379
 
3374
3380
  /**
3375
3381
  * @license