Skip to content

Commit

Permalink
HTTP options per instance (hook)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian.panek committed Jun 27, 2019
1 parent 467e1d1 commit 0611ecb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0611ecb

Please sign in to comment.