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: pass rawHeaders #1240
feat: pass rawHeaders #1240
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1240 +/- ##
==========================================
+ Coverage 93.87% 94.07% +0.19%
==========================================
Files 43 43
Lines 4052 4066 +14
==========================================
+ Hits 3804 3825 +21
+ Misses 248 241 -7
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned that this causes reduced performance for an edge case.
Can we make this an option on the request instead? i.e. whether or not to return raw headers. That way it doesn't affect performance and you get exactly what you want in the fastest way possible. e.g. const {
statusCode,
headers, // rawHeaders
trailers,
body
} = await undici.request('http://url', { responeHeaders: 'raw' }); I'm not sure what the option should be called but I think something like this. |
@ronag makes sense to me, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* Pass raw headers * tests * types * CR Co-authored-by: Moshe Atlow <moshea@testim.io>
* Pass raw headers * tests * types * CR Co-authored-by: Moshe Atlow <moshea@testim.io>
* Pass raw headers * tests * types * CR Co-authored-by: Moshe Atlow <moshea@testim.io>
add rawHeaders whenever we return headers.
hope this PR makes sense
closes #1213