Skip to content

[edf] Update browser UserAgent (Firefox ESR Profile) to help edf.fr

Woob Import requested to merge edf-fix-useragent into master

I noticed that I could not use edf.fr around June 20, 2020 - it failed with a timeout:

2020-06-20 16:02:19,551:WARNING:urllib3.connectionpool:1.0.0:connectionpool.py:744:urlopen Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='particulier.edf.fr', port=443): Read timed out. (read timeout=10.0)")': /services/rest/edoc/getMyDocuments
2020-06-20 16:02:29,637:WARNING:urllib3.connectionpool:1.0.0:connectionpool.py:744:urlopen Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='particulier.edf.fr', port=443): Read timed out. (read timeout=10.0)")': /services/rest/edoc/getMyDocuments
Bug(edf): HTTPSConnectionPool(host='particulier.edf.fr', port=443): Max retries exceeded with url: /services/rest/edoc/getMyDocuments (Caused by ReadTimeoutError("HTTPSConnectionPool(host='particulier.edf.fr', port=443): Read timed out. (read timeout=10.0)"))

In fact, this timeout is caused by the UserAgent, and it seems that edf.fr stopped accepting Firefox 68 (ESR) UserAgent string around that time.

Updating the UserAgent string fixes the issue, no more timeout. 100% reproducible, even if it sounds strange...

As Firefox 78 (ESR) has been updated around June 30, 2020, I believe it's possible to update the Firefox profile. Of course, there is a risk of impact, but the comment in the code seems to allow this kind of update ... Ideally, it should follow the current ESR Firefox ...

Merge request reports