actions / http-client

A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
https://github.com/features/actions
Other
72 stars 33 forks source link

Remove deprecated URL API usage #25

Closed JamieMagee closed 4 years ago

JamieMagee commented 4 years ago

The legacy URL API (provided by require('url')) was deprecated by NodeJS 11 released in October 2018. It is scheduled to be removed in a future release.

The main motivation for this change, is Yarn v2, which does not allow undeclared dependencies to be used. require('url') is ambiguous between the built-in NodeJS module, and the npm package url. I'm assuming the intent is to use the built-in module, so I've migrated to using the new URL API, for which the import is implicit.

bryanmacfarlane commented 4 years ago

Thanks for pointing that out! Can you create an issue highlighting the issues and details? I want to make sure that if someone is pinning to an older http client and at some point in the future it fails, there's a good searchable issue that folks can add comments to later.

JamieMagee commented 4 years ago

@bryanmacfarlane Sure! Opened #26

bryanmacfarlane commented 4 years ago

Thanks @JamieMagee for this contribution!

kouberl commented 3 years ago

Hello, I'm not sure but I think the line

proxyAuth:` ${proxyUrl.username}:${proxyUrl.password}`,

breaks some libraries which are using this library when setting a proxy url without username and password. proxyAuth will be set to ":"

I have a issue at docker/setup-buildx-action: https://github.com/docker/setup-buildx-action/issues/57