将锁定的资源移动到WebDAV中的锁定目标

时间:2014-03-21 07:05:27

标签: http-headers webdav

使用move命令,我已经可以执行此操作:

  • 将普通资源移至正常目的地
  • 将锁定的资源移至正常目的地
  • 将普通资源移至锁定目的地

但是当我尝试将锁定的资源移动到锁定的目标时,我总是得到错误代码424.

请求:

MOVE /pub1/test_data.txt HTTP/1.1
Host: www.myhost.com
Destination: https://www.myhost.com/pub3/test_data.txt
Overwrite: T
If: <https://www.myhost.com/pub1/test_data.txt>(<opaquelocktoken:19e4880c-0fce-477d-8e07-ca13ffe328eb>)<https://www.myhost.com/pub3/test_data.txt>(<opaquelocktoken:5f29e527-7577-4036-a5dc-fb9f83f8434d>)

第一个标记是文件test_data.txt的锁定标记,第二个标记是pub3文件夹的锁定标记。我尝试另一个If标题:

If: (<opaquelocktoken:19e4880c-0fce-477d-8e07-ca13ffe328eb>)(<opaquelocktoken:5f29e527-7577-4036-a5dc-fb9f83f8434d>)

但它也不起作用。

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus>
 <D:response>
<D:href>/pub1</D:href>
<D:status>HTTP/1.1 412 Precondition Failed</D:status>
<D:responsedescription>A validation error has occurred on the parent resource, preventing the operation on the resource specified by the Request-URI. The error was: The precondition(s) specified by the "If:" header did not match this resource. At least one failure is because: a State-token was supplied, but it was not found in the locks on this resource.</D:responsedescription>
 </D:response>
</D:multistatus>

1 个答案:

答案 0 :(得分:1)

在If标头字段中,尝试使用文件夹的URI:

If: <https://www.myhost.com/pub1/test_data.txt>(<opaquelocktoken:19e4880c-0fce-477d-8e07-ca13ffe328eb>)<https://www.myhost.com/pub3/>(<opaquelocktoken:5f29e527-7577-4036-a5dc-fb9f83f8434d>)
相关问题