Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
bitfire web engineering
dav4jvm
Commits
40b4207e
Commit
40b4207e
authored
Oct 01, 2020
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
build.gradle.kts
build.gradle.kts
+1
-1
src/main/kotlin/at/bitfire/dav4jvm/DavResource.kt
src/main/kotlin/at/bitfire/dav4jvm/DavResource.kt
+3
-3
No files found.
build.gradle.kts
View file @
40b4207e
...
...
@@ -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"
...
...
src/main/kotlin/at/bitfire/dav4jvm/DavResource.kt
View file @
40b4207e
...
...
@@ -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"
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment