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

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

parent efe4b08b
Pipeline #196834396 passed with stages
in 3 minutes and 7 seconds
...@@ -15,7 +15,7 @@ repositories { ...@@ -15,7 +15,7 @@ repositories {
} }
plugins { plugins {
kotlin("jvm") version "1.3.72" kotlin("jvm") version "1.4.10"
id("com.github.kukuhyoniatmoko.buildconfigkotlin") version "1.0.5" id("com.github.kukuhyoniatmoko.buildconfigkotlin") version "1.0.5"
id("org.jetbrains.dokka") version "0.10.1" id("org.jetbrains.dokka") version "0.10.1"
......
...@@ -427,14 +427,14 @@ open class DavResource @JvmOverloads constructor( ...@@ -427,14 +427,14 @@ open class DavResource @JvmOverloads constructor(
*/ */
private fun assertMultiStatus(response: Response) { private fun assertMultiStatus(response: Response) {
if (response.code != 207) 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) 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 { response.body?.contentType()?.let {
if (((it.type != "application" && it.type != "text")) || it.subtype != "xml") 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") } ?: log.warning("Received 207 Multi-Status without Content-Type, assuming XML")
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment