Skip to content

fix: omit 'path' in undici.request opts (ts)#559

Merged
mcollina merged 2 commits intonodejs:masterfrom
apostolos:patch-1
Feb 23, 2021
Merged

fix: omit 'path' in undici.request opts (ts)#559
mcollina merged 2 commits intonodejs:masterfrom
apostolos:patch-1

Conversation

@apostolos
Copy link
Copy Markdown
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

@Ethan-Arrowood
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor Author

@mcollina type tests updated

@apostolos apostolos requested a review from mcollina February 21, 2021 18:24
Copy link
Copy Markdown
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
Copy Markdown

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.

5 participants