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(ClientRequest): add rawHeaders symbol to response listener instance #704

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mikicho
Copy link
Contributor

@mikicho mikicho commented Feb 4, 2025

@kettanaito I hope I didn't create an abomination 😅 let me know if this is the way and if there is a more elegant way to achieve this.
The problem is that FetchResponse did not use our Response proxy, resulting in no rawHeaders symbol being created in the instance. By utilizing Reflect.construct, I ensured it went through the proxy as intended.

TODO:

  1. There is a type error in the test
  2. should/can we export the kRawHeaders symbol for the test or use getOwnPropertySymbols?
  3. Add proper comments on the extends & Reflect.construct trick if it's a valid option.

@mikicho mikicho requested a review from kettanaito February 5, 2025 16:02
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.

1 participant