diff --git a/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceHttpClient.kt b/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceHttpClient.kt index b5e85c6e6..5a1af7470 100644 --- a/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceHttpClient.kt +++ b/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceHttpClient.kt @@ -13,7 +13,7 @@ open class InstanceHttpClient(aem: AemExtension, val instance: Instance) : HttpC basicPassword = instance.password authorizationPreemptive = true - apply(aem.instanceOptions.httpOptions) + apply { aem.instanceOptions.httpOptions(this, instance) } } override fun checkStatus(response: HttpResponse, checker: (Int) -> Boolean) { diff --git a/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceOptions.kt b/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceOptions.kt index 8db56b9f8..4ab0bc3d8 100644 --- a/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceOptions.kt +++ b/src/main/kotlin/com/cognifide/gradle/aem/common/instance/InstanceOptions.kt @@ -21,12 +21,12 @@ open class InstanceOptions(private val aem: AemExtension) : Serializable { * - customize maximum time after which initializing connection to AEM will be aborted (e.g on upload, install), * - customize any options offered by Apache HTTP Client builder (use its API directly). */ - fun http(options: InstanceHttpClient.() -> Unit) { + fun http(options: InstanceHttpClient.(Instance) -> Unit) { httpOptions = options } @get:JsonIgnore - internal var httpOptions: InstanceHttpClient.() -> Unit = { + internal var httpOptions: InstanceHttpClient.(Instance) -> Unit = { connectionTimeout = aem.props.int("instance.http.connectionTimeout") ?: 30000 connectionRetries = aem.props.boolean("instance.http.connectionRetries") ?: true connectionIgnoreSsl = aem.props.boolean("instance.http.connectionIgnoreSsl") ?: true