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

feat(Headers): implement Headers Iterator #1423

Merged
merged 1 commit into from May 8, 2022

Conversation

KhafraDev
Copy link
Member

See:

This implements Headers Iterator which is a generator-like... thing... that only has a .next() method. Chrome doesn't implement this entirely correct so I recommend using Firefox to see the correct behavior.

Notes:

  • Typescript's Header types are incorrect! You can't use .return() or .throw() on a Headers iterator (.keys(), .entries(), .values(), Symbol.iterator()).
  • Deno does implement this correctly.
  • The Headers standard doesn't mention Headers Iterator at all so I made this implementation through ✨ trial and error ✨.

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2022

Codecov Report

Merging #1423 (3f85887) into main (740053f) will increase coverage by 0.00%.
The diff coverage is 87.50%.

@@           Coverage Diff           @@
##             main    #1423   +/-   ##
=======================================
  Coverage   94.27%   94.27%           
=======================================
  Files          49       49           
  Lines        4244     4248    +4     
=======================================
+ Hits         4001     4005    +4     
  Misses        243      243           
Impacted Files Coverage Δ
lib/fetch/headers.js 93.42% <87.50%> (+0.17%) ⬆️

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 740053f...3f85887. Read the comment docs.

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.

lgtm

@ronag ronag merged commit 6069f68 into nodejs:main May 8, 2022
@KhafraDev KhafraDev deleted the headers-iterator branch May 8, 2022 19:55
KhafraDev added a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
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.

None yet

4 participants