Skip to content

fix: use http1.1 by default - #148

Merged
jimmyjames merged 2 commits into
mainfrom
fix/use-http1
Feb 13, 2025
Merged

jimmyjames merged 2 commits into
mainfrom
fix/use-http1

Conversation

@jimmyjames

Copy link
Copy Markdown
Contributor

Use HTTP 1.1 by default

Description

Configures the default HttpClient to use HTTP 1.1 by default.

There are issues observed using HTTP 2 with FGA, as observed in #126 and failures related to receiving GOAWAY frames.

This change updates the default configuration to use HTTP 1.1.

It also includes a new constructor for ApiClient, to enable easier configuration for a custom HttpClient. If customers wish to use HTTP 2, with this change they can configure the SDK like the following:

// HttpClient.Builder configured for HTTP 2.0
HttpClient.Builder httpBuilder = HttpClient.newBuilder().version(HttpClient.Version.HTTP_2);

final var apiClient = new ApiClient(httpBuilder);

var fgaClient = new OpenFgaClient(configuration, apiClient);

References

#126

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@jimmyjames
jimmyjames requested a review from a team as a code owner February 13, 2025 03:19
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 32.86%. Comparing base (44a62f3) to head (e098935).

❌ Your project status has failed because the head coverage (32.86%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #148      +/-   ##
============================================
+ Coverage     32.78%   32.86%   +0.07%     
- Complexity      973      974       +1     
============================================
  Files           182      182              
  Lines          6872     6880       +8     
  Branches        764      764              
============================================
+ Hits           2253     2261       +8     
  Misses         4512     4512              
  Partials        107      107              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants