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

Ability to rewrite all urls #208

Open
habemus-papadum opened this issue Oct 18, 2022 · 1 comment
Open

Ability to rewrite all urls #208

habemus-papadum opened this issue Oct 18, 2022 · 1 comment

Comments

@habemus-papadum
Copy link
Contributor

Hi,
small feature request/proposal -- it would be useful to be able to have a hook so that all urls could be re-written prior to download e.g.
https://www.foo.bar/bazz?q=2 --> https://www.foo.bar.myproxy.local/bazz?q=2

perhaps provided by a new function Downloads.url_rewriter!(f::Function) ## f::string->string

While this could be also achieved by using default_downloader! provided in #207, this seems brittle (side note -- implementing it at that level would require Easy.get_url)

This would be a pretty small change but opens up the question of how much global state is desired in this package, where should it live (e.g. as a global URL_REWRITER or implicitly embedded into the default downloader, or maybe there should be a global stack of easy_hooks that are always applied prior to the hooks attached to the Downloader)

Curious to gather thoughts/interest prior to starting work.

Thanks!

@habemus-papadum
Copy link
Contributor Author

Addressed in #209

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

No branches or pull requests

1 participant