Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alist的WebDAV服务协议中能否添加alist的hashinfo,使用rclone就可以增加alist的WebDAV的自定义支持了 #7472

Open
4 tasks
narfa0215 opened this issue Nov 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@narfa0215
Copy link

narfa0215 commented Nov 7, 2024

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

alist的api中存在hashinfo,但WebDAV传递不了例如md5的内容,导致下载后无法进行校验,能否在原有WebDAV协议基础上进行增强,添加alist的相关属性例如hashinfo,这样就可以直接使用checksum检查文件了

Suggested solution / 实现思路

实现思路参考[https://github.com/rclone/rclone/issues/2379],可以实现alist的自定义的标签,也可以做兼容,相关讨论[https://central.owncloud.org/t/reading-hashes-md5-or-sha1-via-webdav/14348/3],以下方案参考[https://github.com/rclone/rclone/issues/3147]。
为了兼容性可以这样处理,普通属性查询请求例如:

<?xml version="1.0" ?>
<D:propfind xmlns:D="DAV:">
 <D:allprop/>
</D:propfind>

不返回自定义属性,使用标准的WebDAV协议,需要指定自定义属性才返回自定义属性

<?xml version="1.0"?>
<d:propfind  xmlns:d="DAV:" xmlns:al="http://alist.nn.ci/ns">
 <d:prop>
  <d:displayname />
  <d:getlastmodified />
  <d:getcontentlength />
  <d:resourcetype />
  <d:getcontenttype />
  <al:checksums />
 </d:prop>
</d:propfind>

或者

<?xml version="1.0"?>
<d:propfind  xmlns:d="DAV:" xmlns:al="http://alist.nn.ci/ns">
 <d:prop>
  <d:displayname />
  <d:getlastmodified />
  <d:getcontentlength />
  <d:resourcetype />
  <d:getcontenttype />
  <al:hashinfo />
 </d:prop>
</d:propfind>

返回内容增加
<al:checksums><al:checksum>SHA1:f572d396fae9206628714fb2ce00f72e94f2258f MD5:b1946ac92492d2347c6235b4d2611184 ADLER32:084b021f</al:checksum></al:checksums>
或者
<al:hashinfo><al:md5>b1946ac92492d2347c6235b4d2611184</al:md5></al:hashinfo>
可以有效增强校验,减少传输错误导致的文件错误

Additional context / 附件

No response

@narfa0215 narfa0215 added the enhancement New feature or request label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant