ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
114 stars 18 forks source link

Add user-agent and request-id headers to artifact download requests #265

Closed alikins closed 5 years ago

alikins commented 5 years ago
SUMMARY

Add useragent and req id headers to download

download.fetch_url() wasn't setting User-Agent or request_id headers on it's requests. And since it also doesn't use/reuse the request.Session from rest_api.RestClient(), it wasn't sending those headers for the artifact downloads.

So add a request_id and the user_agent from new user_agent module to requests.

This is needed to finish https://github.com/ansible/galaxy/pull/1789 which is impl of https://github.com/ansible/galaxy/issues/1769

ISSUE TYPE
MAZER VERSION
name = mazer
version = 0.5.0
config_file = /home/adrian/.ansible/mazer.yml
uname = Linux, newswoop, 5.0.5-200.fc29.x86_64, #1 SMP Wed Mar 27 20:58:04 UTC 2019, x86_64
executable_location = /home/adrian/venvs/mazer_0.4.0_py36/bin/mazer
python_version = 3.6.8 (default, Jan 27 2019, 09:00:23) [GCC 8.2.1 20181215 (Red Hat 8.2.1-6)]
python_executable = /home/adrian/venvs/mazer_0.4.0_py36/bin/python
ADDITIONAL INFORMATION