| 47 | `<?xml version="1.0" encoding="utf-8"?><D:lockinfo xmlns:D="DAV:"><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:href>test-owner</D:href></D:owner></D:lockinfo>`; |
| 48 | |
| 49 | async function lockPath(filePath: string, user: User, depth?: string): Promise<Response> { |
| 50 | const headers: Record<string, string> = {}; |
| 51 | if (depth) { |
| 52 | headers.depth = depth; |
| 53 | } |
| 54 | return await callDav('LOCK', filePath, user, { body: lockRequestBody, headers }); |
| 55 | } |
| 56 | |
| 57 | function getLockTokenFromResponse(response: Response): string { |
| 58 | const lockTokenHeader = response.headers.get('lock-token') || ''; |