Repository: ktorio/ktor
File: ktor-client/ktor-client-core/common/src/io/ktor/client/HttpClientConfig.kt (Kotlin)

Code before:
    /**
     * Builder for configuring engine-specific settings in [HttpClientEngineConfig]
     * (like dispatcher, threads count, proxy, etc.)
     *
     * ```kotlin
     * val client = HttpClient(CIO) { // HttpClientConfig<CIOEngineConfig>
     *     engine { // CIOEngineConfig.() -> Unit
     *         proxy = ProxyBuilder.http("proxy.example.com", 8080)
     *     }
     * ```
     *
     * You can learn more from [Engines](https://ktor.io/docs/http-client-engines.html).
     */
    public fun engine(block: T.() -> Unit) {
        val oldConfig = engineConfig
        engineConfig = {
            oldConfig()
            block()
        }
    }

    /**
     * Specifies whether the client redirects to URLs provided in the `Location` header.
     * You can disable redirections by setting this property to `false`.
     *
     * For the advanced redirection configuration, use [HttpRedirect] plugin.
     */
    public var followRedirects: Boolean = true

    /**
     * Enable body transformations for many common types like [String], [ByteArray], [ByteReadChannel], etc.
     * These transformations are applied to the request and response bodies.
     *
     * The transformers will be used when the response body is received with a type:
     * ```kotlin
     * val client = HttpClient()
     * val bytes = client.get("https://ktor.io")
     *                   .body<ByteArray>()
     * ```
     *
     * The flag is enabled by default.
     * You might want to disable it if you want to write your own transformers or handle body manually.
     *
     * Check [defaultTransformers] documentation for more details.
     */
    public var useDefaultTransformers: Boolean = true

    /**
     * Terminates [HttpClient.receivePipeline] if the status code is not successful (>=300).
     * Learn more from [Response validation](https://ktor.io/docs/response-validation.html).
     *

Review comment (suggestion):
```suggestion
     * For an advanced redirection configuration, use the [HttpRedirect] plugin.
```

Code after:
    /**
     * A builder for configuring engine-specific settings in [HttpClientEngineConfig],
     * such as dispatcher, thread count, proxy, and more.
     *
     * ```kotlin
     * val client = HttpClient(CIO) { // HttpClientConfig<CIOEngineConfig>
     *     engine { // CIOEngineConfig.() -> Unit
     *         proxy = ProxyBuilder.http("proxy.example.com", 8080)
     *     }
     * ```
     *
     * You can learn more from [Engines](https://ktor.io/docs/http-client-engines.html).
     */
    public fun engine(block: T.() -> Unit) {
        val oldConfig = engineConfig
        engineConfig = {
            oldConfig()
            block()
        }
    }

    /**
     * Specifies whether the client redirects to URLs provided in the `Location` header.
     * You can disable redirections by setting this property to `false`.
     *
     * For an advanced redirection configuration, use the [HttpRedirect] plugin.
     */
    public var followRedirects: Boolean = true

    /**
     * Enables body transformations for many common types like [String], [ByteArray], [ByteReadChannel], etc.
     * These transformations are applied to the request and response bodies.
     *
     * The transformers will be used when the response body is received with a type:
     * ```kotlin
     * val client = HttpClient()
     * val bytes = client.get("https://ktor.io")
     *                   .body<ByteArray>()
     * ```
     *
     * This flag is enabled by default.
     * You might want to disable it if you want to write your own transformers or handle body manually.
     *
     * For more details, see the [defaultTransformers] documentation.
     */
    public var useDefaultTransformers: Boolean = true

    /**
     * Terminates [HttpClient.receivePipeline] if the status code is not successful (>=300).
     * Learn more from [Response validation](https://ktor.io/docs/response-validation.html).
     *