@@ -607,10 +607,8 @@ public class HTTPClient {
607
607
set { }
608
608
}
609
609
610
- // TODO: make public
611
- // TODO: set to automatic by default
612
- /// HTTP/2 is by default disabled
613
- internal var httpVersion : HTTPVersion
610
+ /// is set to `.automatic` by default which will use HTTP/2 if run over https and the server supports it, otherwise HTTP/1
611
+ public var httpVersion : HTTPVersion
614
612
615
613
public init (
616
614
tlsConfiguration: TLSConfiguration ? = nil ,
@@ -628,13 +626,11 @@ public class HTTPClient {
628
626
proxy: proxy,
629
627
ignoreUncleanSSLShutdown: ignoreUncleanSSLShutdown,
630
628
decompression: decompression,
631
- // TODO: set to automatic by default
632
- httpVersion: . http1Only
629
+ httpVersion: . automatic
633
630
)
634
631
}
635
632
636
- // TODO: make public
637
- internal init (
633
+ public init (
638
634
tlsConfiguration: TLSConfiguration ? = nil ,
639
635
redirectConfiguration: RedirectConfiguration ? = nil ,
640
636
timeout: Timeout = Timeout ( ) ,
@@ -865,18 +861,17 @@ extension HTTPClient.Configuration {
865
861
}
866
862
}
867
863
868
- // TODO: make this struct and its static properties public
869
- internal struct HTTPVersion {
864
+ public struct HTTPVersion {
870
865
internal enum Configuration {
871
866
case http1Only
872
867
case automatic
873
868
}
874
869
875
870
/// we only use HTTP/1, even if the server would supports HTTP/2
876
- internal static let http1Only : Self = . init( configuration: . http1Only)
871
+ public static let http1Only : Self = . init( configuration: . http1Only)
877
872
878
873
/// HTTP/2 is used if we connect to a server with HTTPS and the server supports HTTP/2, otherwise we use HTTP/1
879
- internal static let automatic : Self = . init( configuration: . automatic)
874
+ public static let automatic : Self = . init( configuration: . automatic)
880
875
881
876
internal var configuration : Configuration
882
877
}
0 commit comments