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: omit 'path' in undici.request opts (ts) #559

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

apostolos
Copy link
Contributor

In undici.request|stream|pipeline helper functions, the opts param may not contain path.

see https://github.com/nodejs/undici#undicirequesturl-opts-promise

Without this fix you get the following Typescript error:

image

But if you pass the path parameter you get a runtime error: https://github.com/nodejs/undici/blob/master/lib/agent.js#L86-L88

In undici.request|stream|pipeline helper functions, the opts param may not contain path.

see https://github.com/nodejs/undici#undicirequesturl-opts-promise
@Ethan-Arrowood
Copy link
Collaborator

Unfortunately the types are quite out of date from the v3 API. I'm okay with this change though to bring it closer - I'm fairly confident not a lot of folks are using undici in TS projects just yet

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

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.

Could you fix the types tests?

@codecov-io
Copy link

codecov-io commented Feb 21, 2021

Codecov Report

Merging #559 (2ffb6ae) into master (138ad61) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #559   +/-   ##
=======================================
  Coverage   99.57%   99.57%           
=======================================
  Files          16       16           
  Lines        1398     1398           
=======================================
  Hits         1392     1392           
  Misses          6        6           

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 138ad61...2ffb6ae. Read the comment docs.

@apostolos
Copy link
Contributor Author

@mcollina type tests updated

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

@Ethan-Arrowood could you take a look?

@mcollina mcollina merged commit 37aa2cc into nodejs:master Feb 23, 2021
@apostolos apostolos deleted the patch-1 branch February 23, 2021 19:50
@thornyweb
Copy link

Hello! I've just run in to this issue in our TS project :)

I can see this code has been merged but not deployed yet, do you have a planned release date at all for this fix?

Thank you!

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

5 participants