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