Skip to content

Commit 04645ec

Browse files
committed
Disable compression for OPTIONS
1 parent aa982a4 commit 04645ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/at/bitfire/dav4jvm/DavResource.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ open class DavResource @JvmOverloads constructor(
8383

8484

8585
/**
86-
* Sends an OPTIONS request to this resource. Doesn't follow redirects.
86+
* Sends an OPTIONS request to this resource without HTTP compression (because some servers have
87+
* broken compression for OPTIONS). Doesn't follow redirects.
8788
*
8889
* @param callback called with server response unless an exception is thrown
8990
*
@@ -97,6 +98,7 @@ open class DavResource @JvmOverloads constructor(
9798
.method("OPTIONS", null)
9899
.header("Content-Length", "0")
99100
.url(location)
101+
.header("Accept-Encoding", "identity") // disable compression
100102
.build()).execute().use { response ->
101103
checkStatus(response)
102104
callback(HttpUtils.listHeader(response, "DAV").map { it.trim() }.toSet(), response)

0 commit comments

Comments
 (0)