Improve dummy-lock handling better this time
authorLanius Trolling <lanius@laniustrolling.dev>
Sun, 22 Dec 2024 20:53:49 +0000 (15:53 -0500)
committerLanius Trolling <lanius@laniustrolling.dev>
Sun, 22 Dec 2024 20:53:49 +0000 (15:53 -0500)
src/main/kotlin/info/mechyrdia/route/ResourceWebDav.kt

index c33a6dff505643e04cc559939b1380b17cbcfb3a..1d0949a9230f24192d56a38d95c9c1443db76e88 100644 (file)
@@ -362,8 +362,6 @@ suspend fun ApplicationCall.webDavLock(path: StoragePath) {
        if (request.header(HttpHeaders.ContentType) != null)
                receiveText()
        
-       val depth = request.header(HttpHeaders.Depth) ?: "Infinity"
-       
        respondXml {
                declaration()
                        .root("prop", namespace = "DAV:") {
@@ -371,12 +369,9 @@ suspend fun ApplicationCall.webDavLock(path: StoragePath) {
                                        "activelock" {
                                                "lockscope" { "shared"() }
                                                "locktype" { "write"() }
-                                               "depth" { +depth }
+                                               "depth" { +"0" }
                                                "owner"()
-                                               "timeout" { +"Second-86400" }
-                                               "locktoken" {
-                                                       "href" { +"opaquelocktoken:${UUID.randomUUID()}" }
-                                               }
+                                               "timeout" { +"Second-31556925000" }
                                        }
                                }
                        }