diff --git a/core/src/commonMain/kotlin/dev/kdriver/core/network/BaseFetchInterception.kt b/core/src/commonMain/kotlin/dev/kdriver/core/network/BaseFetchInterception.kt index 22ff2aeb7..dc7656618 100644 --- a/core/src/commonMain/kotlin/dev/kdriver/core/network/BaseFetchInterception.kt +++ b/core/src/commonMain/kotlin/dev/kdriver/core/network/BaseFetchInterception.kt @@ -54,6 +54,8 @@ open class BaseFetchInterception( override suspend fun getRequestEvent(): Fetch.RequestPausedParameter = responseDeferred.await() + override suspend fun getRequest(): Network.Request = getRequestEvent().request + override suspend fun getRawResponseBody(): EncodedBody { val requestId = getRequestEvent().requestId return EncodedBody(tab.fetch.getResponseBody(requestId)) diff --git a/core/src/commonMain/kotlin/dev/kdriver/core/network/FetchInterception.kt b/core/src/commonMain/kotlin/dev/kdriver/core/network/FetchInterception.kt index 40e308ab8..888d09dbb 100644 --- a/core/src/commonMain/kotlin/dev/kdriver/core/network/FetchInterception.kt +++ b/core/src/commonMain/kotlin/dev/kdriver/core/network/FetchInterception.kt @@ -30,6 +30,11 @@ interface FetchInterception { */ suspend fun getRequestEvent(): Fetch.RequestPausedParameter + /** + * Returns the request once it has been received. + */ + suspend fun getRequest(): Network.Request + /** * Fetches the raw response body once it has been received. */