Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ktor 3.0.0-beta-1 support #239

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object Versions {
const val kotlin = "1.9.10"
const val coroutines = "1.6.1"
const val ktor = "2.0.3"
const val ktor = "3.0.0-beta-1"
const val serialization = "1.0.1"
const val jsoup = "1.13.1"
const val htmlUnit = "2.63.0"
@@ -59,7 +59,7 @@ object Deps {
val serverNetty = dependency("ktor-server-netty")
val serverTestHost = dependency("ktor-server-test-host")
val freemarker = dependency("ktor-server-freemarker")
val locations = dependency("ktor-server-locations")
val resources = dependency("ktor-server-resources")
}

object KotlinX {
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import it.skrape.selects.html5.span
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Test
import strikt.api.expectThat
import strikt.assertions.contains
import strikt.assertions.isEqualTo
import strikt.assertions.isGreaterThanOrEqualTo

@@ -48,7 +49,7 @@ class BleedingEdgeReleaseTest {
}
}

expectThat(title).isEqualTo("Introduction - skrape{it}")
expectThat(title).contains("Introduction").contains("skrape{it}")
}

@Test
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ internal fun io.ktor.http.Cookie.toDomainCookie(origin: String): Cookie {
else -> Domain(domainUrl.urlOrigin, true)
}
val sameSite = this.extensions["SameSite"].toSameSite()
val maxAge = this.maxAge.toMaxAge()
val maxAge = this.maxAge?.toMaxAge()

return Cookie(this.name, this.value, expires, maxAge, domain, path, sameSite, this.secure, this.httpOnly)
}
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ private fun io.ktor.http.Cookie.toDomainCookie(origin: String): Cookie {
else -> Domain(domainUrl.urlOrigin, true)
}
val sameSite = this.extensions["SameSite"].toSameSite()
val maxAge = this.maxAge.toMaxAge()
val maxAge = this.maxAge?.toMaxAge()

return Cookie(this.name, this.value, expires, maxAge, domain, path, sameSite, this.secure, this.httpOnly)
}
2 changes: 1 addition & 1 deletion ktor-extension/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ dependencies {
provided(Deps.Ktor.serverTestHost)
provided(Deps.Ktor.serverNetty)
provided(Deps.Ktor.freemarker)
provided(Deps.Ktor.locations)
provided(Deps.Ktor.resources)
}

// TODO: use https://github.com/nebula-plugins/gradle-extra-configurations-plugin to get provided configuration in gradle
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -25,4 +25,8 @@ dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.4.0")
}

// Gradle Plugin versions are defined in ./buildSrc/build.gradle.kts