Skip to content

Commit 0979bd7

Browse files
ArnyminerZrfc2822
andauthored
Use ktor's HttpHeaders everywhere, and add warning about ktor-okhttp in README (#110)
* Fix misusages of Ktor * Remove mis-commited file * Rename headers class, use const, and add new headers * Add notice to readme * Remove the `UsesKtor` annotation Signed-off-by: Arnau Mora <[email protected]> * Typo Signed-off-by: Arnau Mora <[email protected]> * Typo wtf Signed-off-by: Arnau Mora <[email protected]> * Get rid of `HttpHeaderNames` Signed-off-by: Arnau Mora <[email protected]> * Remove "requires ktor" warnings from kdocs Signed-off-by: Arnau Mora <[email protected]> --------- Signed-off-by: Arnau Mora <[email protected]> Co-authored-by: Ricki Hirner <[email protected]>
1 parent e30f321 commit 0979bd7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ For questions, suggestions etc. use [Github discussions](https://github.com/bitf
1818
We're happy about contributions, but please let us know in the discussions before. Then make the changes
1919
in your own repository and send a pull request.
2020

21+
> [!NOTE]
22+
> dav4jvm is currently being rewritten to use ktor instead of OkHttp to allow Kotlin Multiplatform support, and other engines.
23+
>
24+
> In the mean time, there are two packages available:
25+
> - `at.bitfire.dav4jvm.okhttp` (the current one, using OkHttp, JVM only)
26+
> - `at.bitfire.dav4jvm.ktor` (new package, uses ktor, supports Kotlin Multiplatform)
27+
>
28+
> There's some common code shared between both packages. This code may contain references to ktor, so do not exclude the dependency, even if you are only using okhttp.
29+
2130

2231
## Installation
2332

src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import at.bitfire.dav4jvm.Property
1414
import at.bitfire.dav4jvm.PropertyFactory
1515
import at.bitfire.dav4jvm.QuotedStringUtils
1616
import at.bitfire.dav4jvm.XmlReader
17-
import at.bitfire.dav4jvm.property.webdav.GetETag
1817
import io.ktor.client.statement.HttpResponse
1918
import io.ktor.http.HttpHeaders
2019
import okhttp3.Response

src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ data class GetETag(
3737
response.headers[HttpHeaders.ETag]?.let { GetETag(it) }
3838

3939
fun fromResponse(response: Response) =
40-
response.header("ETag")?.let { GetETag(it) }
40+
response.header(HttpHeaders.ETag)?.let { GetETag(it) }
4141
}
4242

4343
/**

0 commit comments

Comments
 (0)