Skip to content

Ability to rewrite all urls #208

@habemus-papadum

Description

@habemus-papadum

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions