kinto-http.py
kinto-http.py copied to clipboard
Add a user_agent Session parameter to be able to override the default one.
I tried Client
constructor, update_record method or even Session but with no luck.
I was trying to override the User-Agent
headers={'User-Agent': 'backoffice {}'.format(version)}
We never added a generic headers
parameter to everything because of our experience with kinto-http.js, where it serves multiple purposes that are difficult to untangle. See the discussion on https://github.com/Kinto/kinto-http.py/issues/125. My stance on the topic is still that I'd much rather see specific options for specific use cases. For instance, maybe we should put a user_agent
option on Client
, the same way there's an auth
option.
Hey, I'm a newbie and I'd like to work on this. Can I take this up and could you give me a few pointers and help on how to get started
Yes please do :+1:
could you give me a few pointers and help on how to get started
@Natim ?
Sorry I missed that part @leplatrem :confused:
I second what @glasserc said on the subject.
So I would start by adding a user_agent
parameter to the client.__init__
function that would go all the way to overriding the user_agent
header in the request.
Maybe we can also check if the parameter is a callable in case we want to build the user_agent
for each request.
In terms of development flow:
- Start by forking and creating a branch to your fork with a commit that adds a first test about passing the parameter and overriding the default and current behaviour
- Then add commits to that branch until you are happy with it.
Along the way I can comment your code so that we can iterate until we get a version that represent what we expect as a feature set for this issue.
Hope this helps.
This issue seems to be open for few years. I am new and would like to give it a try.
I think I have completed the fix. I need to test it locally and have some questions in how to do that. Do we have slack channel or somewhere that I can get live help? Thanks in advance.