Skip to content

Commit 1c56a4c

Browse files
authored
feat: Kotlin: make Transport class open for extension to allow custom HTTP Transports (#1519)
Fixes #1380 🦕
1 parent 87b0976 commit 1c56a4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kotlin/src/main/com/looker/rtl/Transport.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fun customInitializer(
211211
}
212212
}
213213

214-
class Transport(val options: TransportOptions) {
214+
open class Transport(val options: TransportOptions) {
215215

216216
private val apiPath = "${options.baseUrl}/api/${options.apiVersion}"
217217

@@ -240,7 +240,7 @@ class Transport(val options: TransportOptions) {
240240
} + addQueryParams(path, queryParams)
241241
}
242242

243-
private fun getAllTrustingVerifiers(): Pair<SSLSocketFactory, HostnameVerifier> {
243+
open fun getAllTrustingVerifiers(): Pair<SSLSocketFactory, HostnameVerifier> {
244244
// NOTE! This is completely insecure and should ONLY be used with local server instance
245245
// testing for development purposes
246246
val tm: X509TrustManager = object : X509TrustManager {
@@ -276,7 +276,7 @@ class Transport(val options: TransportOptions) {
276276
*
277277
* Will disable SSL certificate verification iff [TransportOptions.verifySSL] is false.
278278
*/
279-
fun initTransport(options: TransportOptions): HttpTransport {
279+
open fun initTransport(options: TransportOptions): HttpTransport {
280280
return when (HttpTransports.valueOf(options.httpTransport.uppercase())) {
281281
HttpTransports.APACHE -> {
282282
// TODO: fix bug upstream that does not pass client context to requests.

0 commit comments

Comments
 (0)