scoop:scoop.http.client:0.1.0
src/cookie/options.scoop
Selected production source · src/cookie/options.scoop
1
package scoop.http.client3
import scoop.http.HttpCookieHeader4
import scoop.http.HttpResponseHead5
import scoop.url.Url6
import scoop.url.UrlOrigin8
/**9
* Suspendable request-cookie selection and response-cookie storage. Implementations define10
* persistence and context policy.11
*/12
public interface CookieJar {13
/**14
* Selects cookie pairs for the request URL and available request context.15
*/16
public suspend fun load(request: HttpRequest): HttpCookieHeader17
/**18
* Processes each response Set-Cookie field for the request URL.19
*/20
public suspend fun save(request: HttpRequest, response: HttpResponseHead)21
}23
/**24
* The initiating site and top-level-navigation context used when a cookie jar enforces SameSite.25
*/26
public class HttpCookieContext public constructor(27
/**28
* The initiating site URL used for schemeful SameSite comparison, when known.29
*/30
public val site: Url? = None,31
/**32
* Whether this request is a top-level navigation.33
*/34
public val isTopLevelNavigation: Boolean = false35
) {36
internal val origin: UrlOrigin? = if (clientPresent(site)) Some(site!!.httpOrigin()) else None37
}