Repository: ktorio/ktor
File: ktor-client/ktor-client-plugins/ktor-client-content-negotiation/common/src/io/ktor/client/plugins/contentnegotiation/ContentNegotiation.kt (Kotlin)

Code before:
import io.ktor.http.*
import io.ktor.http.content.*
import io.ktor.serialization.*
import io.ktor.util.AttributeKey
import io.ktor.util.logging.*
import io.ktor.util.reflect.*
import io.ktor.utils.io.*
import io.ktor.utils.io.charsets.*
import kotlin.reflect.*

private val LOGGER = KtorSimpleLogger("io.ktor.client.plugins.contentnegotiation.ContentNegotiation")

internal val DefaultCommonIgnoredTypes: Set<KClass<*>> = setOf(
    ByteArray::class,
    String::class,
    HttpStatusCode::class,
    ByteReadChannel::class,
    OutgoingContent::class
)

internal expect val DefaultIgnoredTypes: Set<KClass<*>>

/**
 * Shows that request should skip auth and refresh token procedure.
 */
public val ExcludeContentTypes: AttributeKey<List<ContentType>> = AttributeKey("exclude-content-types")

/**
 * A [ContentNegotiation] configuration that is used during installation.
 */
@KtorDsl
public class ContentNegotiationConfig : Configuration {

    internal class ConverterRegistration(
        val converter: ContentConverter,
        val contentTypeToSend: ContentType,
        val contentTypeMatcher: ContentTypeMatcher
    )

    internal val ignoredTypes: MutableSet<KClass<*>> =
        (DefaultIgnoredTypes + DefaultCommonIgnoredTypes).toMutableSet()

    internal val registrations = mutableListOf<ConverterRegistration>()

    /**
     * By default, `Accept` headers for registered content types will have no q value (implicit 1.0). Set this to
     * change that behavior. This is useful to override the preferred `Accept` content types on a per-request basis.
     */
    public var defaultAcceptHeaderQValue: String? = null

    /**

Review comment (suggestion):
minor: I would rename it to `ExcludedContentTypes` and it's better to use name `AttributeKey("ExcludedContentTypesAttr")` for consistency

Code after:
import io.ktor.http.*
import io.ktor.http.content.*
import io.ktor.serialization.*
import io.ktor.util.AttributeKey
import io.ktor.util.logging.*
import io.ktor.util.reflect.*
import io.ktor.utils.io.*
import io.ktor.utils.io.charsets.*
import kotlin.reflect.*

private val LOGGER = KtorSimpleLogger("io.ktor.client.plugins.contentnegotiation.ContentNegotiation")

internal val DefaultCommonIgnoredTypes: Set<KClass<*>> = setOf(
    ByteArray::class,
    String::class,
    HttpStatusCode::class,
    ByteReadChannel::class,
    OutgoingContent::class
)

internal expect val DefaultIgnoredTypes: Set<KClass<*>>

/**
 * The content types that are excluded from the `Accept` header for this specific request. Use the
 * [exclude] `HttpRequestBuilder` extension to set this attribute on a request.
 */
internal val ExcludedContentTypes: AttributeKey<List<ContentType>> = AttributeKey("ExcludedContentTypesAttr")

/**
 * A [ContentNegotiation] configuration that is used during installation.
 */
@KtorDsl
public class ContentNegotiationConfig : Configuration {

    internal class ConverterRegistration(
        val converter: ContentConverter,
        val contentTypeToSend: ContentType,
        val contentTypeMatcher: ContentTypeMatcher
    )

    internal val ignoredTypes: MutableSet<KClass<*>> =
        (DefaultIgnoredTypes + DefaultCommonIgnoredTypes).toMutableSet()

    internal val registrations = mutableListOf<ConverterRegistration>()

    /**
     * By default, `Accept` headers for registered content types will have no q value (implicit 1.0). Set this to
     * change that behavior. This is useful to override the preferred `Accept` content types on a per-request basis.
     */
    public var defaultAcceptHeaderQValue: Double? = null