@google-cloud+storage++teeny-request+8.0.3.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 af5d15e..8a9bf77 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. @@ -168,31 +168,34 @@ function teenyRequest(reqOpts, callback) {
  6. // Stream mode
  7. const requestStream = streamEvents(new stream_1.PassThrough());
  8. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  9. - let responseStream;
  10. - requestStream.once('reading', () => {
  11. - if (responseStream) {
  12. - (0, stream_1.pipeline)(responseStream, requestStream, () => { });
  13. - }
  14. - else {
  15. - requestStream.once('response', () => {
  16. - (0, stream_1.pipeline)(responseStream, requestStream, () => { });
  17. - });
  18. - }
  19. - });
  20. + // let responseStream;
  21. + // requestStream.once('reading', () => {
  22. + // if (responseStream) {
  23. + // (0, stream_1.pipeline)(responseStream, requestStream, () => { });
  24. + // }
  25. + // else {
  26. + // requestStream.once('response', () => {
  27. + // (0, stream_1.pipeline)(responseStream, requestStream, () => { });
  28. + // });
  29. + // }
  30. + // });
  31. +
  32. +
  33. options.compress = false;
  34. teenyRequest.stats.requestStarting();
  35. (0, node_fetch_1.default)(uri, options).then(res => {
  36. - teenyRequest.stats.requestFinished();
  37. - responseStream = res.body;
  38. - responseStream.on('error', (err) => {
  39. - requestStream.emit('error', err);
  40. - });
  41. + teenyRequest.stats.requestFinished(); stream_1.pipeline(res.body, requestStream, () => {});
  42. + // responseStream = res.body;
  43. + // responseStream.on('error', (err) => {
  44. + // requestStream.emit('error', err);
  45. + // });
  46. const response = fetchToRequestResponse(options, res);
  47. requestStream.emit('response', response);
  48. }, err => {
  49. teenyRequest.stats.requestFinished();
  50. requestStream.emit('error', err);
  51. });
  52. +
  53. // fetch doesn't supply the raw HTTP stream, instead it
  54. // returns a PassThrough piped from the HTTP response
  55. // stream.