Skip to content

Commit 7502023

Browse files
committed
Always use HTTP 1.1 for requests
Currently we use HTTP/2 as a default but this produces problems with GOAWAY from servers breaking the download. For now we disable HTTP72 explicitly and should later have an option for the cleint to enable HTTP72 on demand.
1 parent ac1c442 commit 7502023

File tree

1 file changed

+2
-1
lines changed
  • providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclientjava/src/org/eclipse/ecf/internal/provider/filetransfer/httpclientjava

1 file changed

+2
-1
lines changed

providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclientjava/src/org/eclipse/ecf/internal/provider/filetransfer/httpclientjava/ECFHttpClientFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.net.Authenticator;
1717
import java.net.http.HttpClient;
1818
import java.net.http.HttpClient.Redirect;
19+
import java.net.http.HttpClient.Version;
1920
import java.net.http.HttpRequest;
2021
import java.security.NoSuchAlgorithmException;
2122
import java.security.NoSuchProviderException;
@@ -51,7 +52,7 @@ public class ECFHttpClientFactory implements IHttpClientFactory {
5152

5253
@Override
5354
public HttpClient.Builder newClient() {
54-
HttpClient.Builder builder = HttpClient.newBuilder().followRedirects(Redirect.NORMAL);
55+
HttpClient.Builder builder = HttpClient.newBuilder().version(Version.HTTP_1_1).followRedirects(Redirect.NORMAL);
5556
String sslContextProvider = HttpClientOptions.HTTPCLIENT_SSLCONTEXT_PROVIDER;
5657
String sslContextProtocol = HttpClientOptions.HTTPCLIENT_SSLCONTEXT_PROTOCOL;
5758
SSLContextFactory sslContextFactory = Activator.getDefault().getSSLContextFactory();

0 commit comments

Comments
 (0)