@google-cloud+storage++teeny-request+8.0.2.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. diff --git a/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js b/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js
  2. index a2251ca..e29e796 100644
  3. --- a/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js
  4. +++ b/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js
  5. @@ -166,27 +166,27 @@ function teenyRequest(reqOpts, callback) {
  6. }
  7. if (callback === undefined) {
  8. // Stream mode
  9. - const requestStream = streamEvents(new stream_1.PassThrough());
  10. - // eslint-disable-next-line @typescript-eslint/no-explicit-any
  11. - let responseStream;
  12. - requestStream.once('reading', () => {
  13. - if (responseStream) {
  14. - responseStream.pipe(requestStream);
  15. - }
  16. - else {
  17. - requestStream.once('response', () => {
  18. - responseStream.pipe(requestStream);
  19. - });
  20. - }
  21. - });
  22. + const requestStream = new stream_1.PassThrough();
  23. + // // eslint-disable-next-line @typescript-eslint/no-explicit-any
  24. + // let responseStream;
  25. + // requestStream.once('reading', () => {
  26. + // if (responseStream) {
  27. + // responseStream.pipe(requestStream);
  28. + // }
  29. + // else {
  30. + // requestStream.once('response', () => {
  31. + // responseStream.pipe(requestStream);
  32. + // });
  33. + // }
  34. + // });
  35. options.compress = false;
  36. teenyRequest.stats.requestStarting();
  37. (0, node_fetch_1.default)(uri, options).then(res => {
  38. - teenyRequest.stats.requestFinished();
  39. - responseStream = res.body;
  40. - responseStream.on('error', (err) => {
  41. - requestStream.emit('error', err);
  42. - });
  43. + teenyRequest.stats.requestFinished(); stream_1.pipeline(res.body, requestStream, () => {});
  44. + // responseStream = res.body;
  45. + // responseStream.on('error', (err) => {
  46. + // requestStream.emit('error', err);
  47. + // });
  48. const response = fetchToRequestResponse(options, res);
  49. requestStream.emit('response', response);
  50. }, err => {