Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lazy decode body #1276

Merged
merged 12 commits into from Mar 19, 2022
Merged

fix: lazy decode body #1276

merged 12 commits into from Mar 19, 2022

Conversation

ronag
Copy link
Member

@ronag ronag commented Mar 12, 2022

Don't start prefetching the body before headers and status
has been processed.

Fixes: #1271

@ronag ronag requested a review from mcollina March 12, 2022 13:26
@ronag ronag marked this pull request as draft March 12, 2022 13:27
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2022

Codecov Report

Merging #1276 (0b94906) into main (34f1676) will increase coverage by 2.37%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1276      +/-   ##
==========================================
+ Coverage   94.11%   96.48%   +2.37%     
==========================================
  Files          44       33      -11     
  Lines        4093     2562    -1531     
==========================================
- Hits         3852     2472    -1380     
+ Misses        241       90     -151     
Impacted Files Coverage Δ
index.js 85.13% <0.00%> (-14.87%) ⬇️
lib/core/util.js 87.78% <0.00%> (-10.69%) ⬇️
lib/api/readable.js 80.17% <0.00%> (-8.63%) ⬇️
lib/handler/redirect.js 87.34% <0.00%> (-7.60%) ⬇️
lib/core/errors.js 91.39% <0.00%> (-3.23%) ⬇️
lib/fetch/index.js
lib/fetch/constants.js
lib/fetch/response.js
lib/fetch/body.js
lib/fetch/symbols.js
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34f1676...0b94906. Read the comment docs.

@ronag ronag marked this pull request as ready for review March 12, 2022 13:33
@ronag ronag changed the title fix: lazy read body fix: lazy decode body Mar 12, 2022
Don't start decoding the body before headers and status
has been processed.

Fixes: #1271
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a unit test?

@ronag
Copy link
Member Author

ronag commented Mar 13, 2022

@minas90 Would you mind helping with a test?

@ronag
Copy link
Member Author

ronag commented Mar 19, 2022

Maybe @KhafraDev can help with test?

@KhafraDev
Copy link
Member

I couldn't replicate the issue

@ronag ronag merged commit 31f3318 into main Mar 19, 2022
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
* fix: lazy decode body

Don't start decoding the body before headers and status
has been processed.

Fixes: nodejs#1271

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
* fix: lazy decode body

Don't start decoding the body before headers and status
has been processed.

Fixes: nodejs#1271

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup
@Uzlopak Uzlopak deleted the 1271 branch February 21, 2024 12:36
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* fix: lazy decode body

Don't start decoding the body before headers and status
has been processed.

Fixes: nodejs#1271

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup

* fixup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: fetch failed
4 participants