Allow disabling of HTTP/2 support
The client uses okhttp3, which supports, by default, HTTP/2 and HTTP/1.1 protocol, through protocol negotiation.
Unfortunately, on networks with variable latency, it often happen that the negotiation fails, and the call to Flagsmith server ends up in error.
This is a recurring problem with okhttp3 (and how HTTP/2 handle the initial connection) that has been documented in several places:
- https://www.twilio.com/en-us/blog/http2-issues-html
- https://github.com/square/okhttp/issues/3955
The proposed change is to augment the FlagsmithConfig.Builder class to allow selection of supported protocols.
Interesting, thanks for the details here @olivier-hubaut . We will add this into our backlog, but equally we're happy to receive a PR on this.
Hi!
I submitted the PR one month ago. Is there something I should adapt? As of now, this issue is problematic for us. So much that we now use a patched version of the java client in our applications.
@olivier-hubaut this has just been released as part of v7.4.0.