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

data_loader.ex does not customize default hackney User-Agent string #34

Open
ptudor opened this issue Mar 9, 2017 · 0 comments
Open

Comments

@ptudor
Copy link

ptudor commented Mar 9, 2017

Hi,

It looks like the data_loader.ex file does not customize the default user agent. It would be useful to set that to a unique value to politely identify the source of http requests.

Untested code would be something like...
Before:

{:ok, 200, _headers, client_ref}=:hackney.get(url, [], "", [])

After:

tz_ua = [<<"User-Agent: ", "tzdata/", version/binary, " (https://github.com/lau/tzdata)" >>],
{:ok, 200, _headers, client_ref}=:hackney.get(url, tz_ua, "", [])

For the sake of reference easily copy-and-pasted, hackney's default_ua() is created in hackney_request.erl.

Thanks,

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