cdsapi icon indicating copy to clipboard operation
cdsapi copied to clipboard

Replaced default python-requests user-agent with a custom ones

Open keul opened this issue 2 years ago • 1 comments

Default user-agent sent by cdsapi is inherited from it's dependency python-requests, which is python-requests/x.y.z

So it's not easy to know if the request came from official cdsapi or another Python code script that use python-requests under the hood.

Changing this can improve log analysis and QoS a bit (at least for 99% of users).

HTTP access log will now contains a user-agent field like the following:

… "cdsapi/0.5.1"

keul avatar Mar 26 '22 11:03 keul

CLA assistant check
All committers have signed the CLA.

FussyDuck avatar Mar 26 '22 11:03 FussyDuck

Hi @keul , Is this PR still relevant and useful? If so can you resolve the conflict and I will then review it and merge Thanks, Eddy

EddyCMWF avatar Feb 27 '23 15:02 EddyCMWF

@EddyCMWF I think it can still be relevant. At the time I was trying to intercept users using the cdsapi, while right now there's not way to differentiate them from other people using "vanilla" Python requests.

If you think it can be useful I can fix conflicts

keul avatar Feb 27 '23 16:02 keul

This should be merged asap

gbiavati avatar Feb 28 '23 11:02 gbiavati

@gbiavati @EddyCMWF conflicts are fixed

keul avatar Feb 28 '23 14:02 keul