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

feat(install): follow redirects for urls with no path #17449

Merged
merged 2 commits into from
Feb 10, 2023
Merged

feat(install): follow redirects for urls with no path #17449

merged 2 commits into from
Feb 10, 2023

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Jan 16, 2023

This change makes absolute urls, that contain no path like deno install https://my-cli.io to follow redirects and extract the name from it.

It allows modifies test_util server listener on port 4550 (REDIRECT_ABSOLUTE_PORT) to allow for specifying redirect_to query param, that fill use that value for it's next redirect.

Note: it uses tokio::Runtime::block_on as HttpClient methods are all async, but I didn’t want to translate whole pipeline into async, due to the fact that the case I’m solving here is rather rare one.

Fixes #17409

cli/tools/installer.rs Outdated Show resolved Hide resolved
@kamilogorek
Copy link
Contributor Author

@dsherret I took some time and rewrote it using async/await. No need to create a new runtime anymore :)

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for doing this!

@dsherret dsherret changed the title ref(install): Follow redirects for urls with no path feat(install): follow redirects for urls with no path Feb 10, 2023
@dsherret dsherret added this to the 1.31 milestone Feb 10, 2023
@dsherret dsherret merged commit 5778e11 into denoland:main Feb 10, 2023
@kamilogorek kamilogorek deleted the install-follow-redirect branch February 10, 2023 15:15
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.

deno install does infer executable name from redirect
2 participants