teeny-request+7.1.3.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. diff --git a/node_modules/teeny-request/build/src/index.js b/node_modules/teeny-request/build/src/index.js
  2. index f209888..e9fe982 100644
  3. --- a/node_modules/teeny-request/build/src/index.js
  4. +++ b/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. + const requestStream = new stream_1.PassThrough();
  11. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  12. - let responseStream;
  13. - requestStream.once('reading', () => {
  14. - if (responseStream) {
  15. - responseStream.pipe(requestStream);
  16. - }
  17. - else {
  18. - requestStream.once('response', () => {
  19. - responseStream.pipe(requestStream);
  20. - });
  21. - }
  22. - });
  23. + // let responseStream;
  24. + // requestStream.once('reading', () => {
  25. + // if (responseStream) {
  26. + // responseStream.pipe(requestStream);
  27. + // }
  28. + // else {
  29. + // requestStream.once('response', () => {
  30. + // responseStream.pipe(requestStream);
  31. + // });
  32. + // }
  33. + // });
  34. options.compress = false;
  35. teenyRequest.stats.requestStarting();
  36. node_fetch_1.default(uri, options).then(res => {
  37. - teenyRequest.stats.requestFinished();
  38. - responseStream = res.body;
  39. - responseStream.on('error', (err) => {
  40. - requestStream.emit('error', err);
  41. - });
  42. + teenyRequest.stats.requestFinished(); stream_1.pipeline(res.body, requestStream, () => {});
  43. + // responseStream = res.body;
  44. + // responseStream.on('error', (err) => {
  45. + // requestStream.emit('error', err);
  46. + // });
  47. const response = fetchToRequestResponse(options, res);
  48. requestStream.emit('response', response);
  49. }, err => {