Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40b4207e authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Add response to "expected 207, got 200" message; update Kotlin

parent efe4b08b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ repositories {
}

plugins {
    kotlin("jvm") version "1.3.72"
    kotlin("jvm") version "1.4.10"

    id("com.github.kukuhyoniatmoko.buildconfigkotlin") version "1.0.5"
    id("org.jetbrains.dokka") version "0.10.1"
+3 −3
Original line number Diff line number Diff line
@@ -427,14 +427,14 @@ open class DavResource @JvmOverloads constructor(
     */
    private fun assertMultiStatus(response: Response) {
        if (response.code != 207)
            throw DavException("Expected 207 Multi-Status, got ${response.code} ${response.message}")
            throw DavException("Expected 207 Multi-Status, got ${response.code} ${response.message}", httpResponse = response)

        if (response.body == null)
            throw DavException("Received 207 Multi-Status without body")
            throw DavException("Received 207 Multi-Status without body", httpResponse = response)

        response.body?.contentType()?.let {
            if (((it.type != "application" && it.type != "text")) || it.subtype != "xml")
                throw DavException("Received non-XML 207 Multi-Status")
                throw DavException("Received non-XML 207 Multi-Status", httpResponse = response)
        } ?: log.warning("Received 207 Multi-Status without Content-Type, assuming XML")
    }