Add User-Agent header to API requests#796
Add User-Agent header to API requests#796twsl wants to merge 1 commit intogramps-project:maintenance/gramps60from
Conversation
|
Did you check this actually works? If so, I wonder why. The official Python documentation states
So even without setting a user agent, the library will send one. So just setting this to any non-empty value cannot be the solution. It could be that Cloudflare explicitly rejects user agents starting with See e.g. a similar issue with Nextcloud sync: nextcloud/desktop#7070 |
|
I ran the code block for token retrieval quickly in command line and it worked. Initially it worked in gramps without user agent as well but at some point I started getting the 403 error message despite using the same password. |
|
I mean, it doesn't hurt to add this, so if it helps you, I think it's ok. But I'd like to understand better why this actually works - so if CF is explicitly blocking the default agent. |
|
A quick google search suggest that the |
|
Ok in that case I'm ok to merge it. Let me know if you want to modify anything else. I don't think version number is easily doable, we don't wanna have to keep it in sync manually |
|
Moving the plugin version from the |
Not sure I follow. The plugin version belongs in the gpr. It gets auto-updated when a new version is published, so no need to make that change in the PR. In this case, the current plugin version is 1.3.6 . Once the PR is merged/published, it will be 1.3.7 . |
|
I wasn't aware this is generated. Then I'd say this is good to go |
|
I can't formally submit a review, but I approve the changes. |
Without providing a user agent, cloudflare, which runs in front of my gramps web instance, returns an error 1010 which results in a 403 access denied