<commit_before>package io.ktor.client.features.cookies

import io.ktor.http.*

/**
 * Storage for [Cookie].
 */
interface CookiesStorage {
    /**
     * Gets a map of [String] to [Cookie] for a specific [host].
     */
    suspend fun get(requestUrl: Url): List<Cookie>

    /**
     * Sets a [cookie] for the specified [host].
     */
    suspend fun addCookie(requestUrl: Url, cookie: Cookie)
}

suspend fun CookiesStorage.addCookie(urlString: String, cookie: Cookie) {
    addCookie(Url(urlString), cookie)
}

internal fun Cookie.matches(requestUrl: Url): Boolean {
    val domain = domain?.toLowerCase() ?: error("Domain field should have the default value")
    val path = with(path) {
        val current = path?.toLowerCase() ?: error("Path field should have the default value")<commit_msg>Ignore leading dot in cookie domain<commit_after>package io.ktor.client.features.cookies

import io.ktor.http.*

/**
 * Storage for [Cookie].
 */
interface CookiesStorage {
    /**
     * Gets a map of [String] to [Cookie] for a specific [host].
     */
    suspend fun get(requestUrl: Url): List<Cookie>

    /**
     * Sets a [cookie] for the specified [host].
     */
    suspend fun addCookie(requestUrl: Url, cookie: Cookie)
}

suspend fun CookiesStorage.addCookie(urlString: String, cookie: Cookie) {
    addCookie(Url(urlString), cookie)
}

internal fun Cookie.matches(requestUrl: Url): Boolean {
    val domain = domain?.toLowerCase()?.trimStart('.') ?: error("Domain field should have the default value")
    val path = with(path) {
        val current = path?.toLowerCase() ?: error("Path field should have the default value")
{'fraction_non_alphanumeric': 0.1291309669522644, 'fraction_numerical': 0.0, 'mean_word_length': 3.5416666666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4445099', 'n_tokens_mistral': 479, 'n_tokens_neox': 485, 'n_words': 152}