Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use http1.1 by default #148

Merged
merged 2 commits into from
Feb 13, 2025
Merged

fix: use http1.1 by default #148

merged 2 commits into from
Feb 13, 2025

Conversation

jimmyjames
Copy link
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

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.

@jimmyjames jimmyjames added this pull request to the merge queue Feb 13, 2025
Merged via the queue into main with commit de4e783 Feb 13, 2025
19 checks passed
@jimmyjames jimmyjames deleted the fix/use-http1 branch February 13, 2025 04:13
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