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

HTTP Version Compatibility Problem in 0.9.0 Release #166

Open
pstutz opened this issue Jul 27, 2024 · 0 comments
Open

HTTP Version Compatibility Problem in 0.9.0 Release #166

pstutz opened this issue Jul 27, 2024 · 0 comments

Comments

@pstutz
Copy link

pstutz commented Jul 27, 2024

Issue Description

After upgrading to the 0.9.0 release, connections that previously worked are now failing with the following error:

Caused by: requests.RequestsException: Received RST_STREAM: Use HTTP/1.1 for request
    at requests.Requester$$anon$1.readBytesThrough(Requester.scala:293)
    at geny.Readable.writeBytesTo(Writable.scala:93)
    at geny.Readable.writeBytesTo$(Writable.scala:91)
    at requests.Requester$$anon$1.writeBytesTo(Requester.scala:191)
    at requests.Requester.apply(Requester.scala:140)

Current Situation

The underlying HttpClient supports setting the HTTP version:

HttpClient client = HttpClient.newBuilder().version(Version.HTTP_1_1)

However, this functionality is not exposed in the new 0.9.0 release. The HttpClient seems to manage protocol versions differently by default, and the current requests API doesn't provide a way to address this issue.

Root Cause

The HttpClient appears to use HTTP/2 by default:

if (builder.version == null) {
    version = HttpClient.Version.HTTP_2;
} else {
    version = builder.version;
}

Proposed Solution

It would be helpful if the new API allowed setting HTTP/1.1 as the default version to maintain compatibility with services that don't support HTTP/2.

Additional Notes

This change would be crucial for maintaining backward compatibility with services that rely on HTTP/1.1.

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

No branches or pull requests

1 participant