From 73c07402c25584c051bf04b8df1886c519f49f8c Mon Sep 17 00:00:00 2001 From: terminal Date: Thu, 8 Sep 2022 16:49:12 +0300 Subject: [PATCH] prefer http option --- .../emeraldpay/dshackle/config/UpstreamsConfigReader.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt index 2dc43a68..91ea1d48 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt @@ -183,6 +183,9 @@ class UpstreamsConfigReader( http.tls = authConfigReader.readClientTls(node) } } + getValueAsBool(connConfigNode, "prefer-http")?.let { + connection.preferHttp = it + } getMapping(connConfigNode, "ws")?.let { node -> getValueAsString(node, "url")?.let { url -> val ws = UpstreamsConfig.WsEndpoint(URI(url)) @@ -256,7 +259,7 @@ class UpstreamsConfigReader( } internal fun readUpstreamGrpc( - upNode: MappingNode, + upNode: MappingNode ) { if (hasAny(upNode, "chain")) { log.warn("Chain should be not applied to gRPC upstream") @@ -309,7 +312,8 @@ class UpstreamsConfigReader( }?.filterNotNull()?.toSet() ?: emptySet() UpstreamsConfig.Methods( - enabled, disabled + enabled, + disabled ) } }