Skip to content

[BUG] WebDAV 服务器不兼容RFC 9110 HTTP Semantics(ETag / Preconditions) #3065

Description

@jyeric

请确认以下事项

  • 我已确认阅读并同意 AGPL-3.0 第15条 。
    本程序不提供任何明示或暗示的担保,使用风险由您自行承担。

  • 我已确认阅读并同意 AGPL-3.0 第16条 。
    无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。

  • 我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。

  • 我已确认阅读了OpenList文档。

  • 我已确认没有重复的问题或讨论。

  • 我已确认是OpenList的问题,而不是其他原因(例如 网络 ,依赖或操作)。

  • 我认为此问题必须由OpenList处理,而非第三方。

  • 我已确认这个问题在最新版本中没有被修复。

  • 我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。

OpenList 版本(必填)

v4.2.4

使用的存储驱动(必填)

local

问题描述(必填)

If-Match, If-None-Match, ETag等使用可以有效避免文件被多个进程争抢覆盖(乐观锁)。目前openlist的webdav服务器实现上不符合 RFC9110 section-13.1.1和RFC9110 section-8.8.3,在不应覆盖文件的情况下错误的覆盖了文件。同时返回201 Created

下面是测试结果(以下为AI生成):

条件写入测试结果

测试 正确行为 实际行为 结果
创建不存在的随机文件,If-None-Match: * 创建成功 201,创建成功 正常
文件已存在,If-None-Match: * 412,不得覆盖 201,内容被覆盖 错误
If-None-Match: 当前 ETag 412,不得覆盖 201,内容被覆盖 错误
If-Match: 错误 ETag 412,不得覆盖 201,内容被覆盖 错误
If-Match: 当前 ETag 更新成功 201,内容更新 条件无法证明生效
If-Match: 过期 ETag 412,不得覆盖 201,内容被覆盖 错误
覆盖已有文件时的状态码 200 或 204 始终返回 201 Created 错误

此外,文件修改后 ETag 仍然一致,强 ETag 相同应当表示两个资源表示逐字节相同。在ETag的实现上也存在问题。

日志(必填)

[21:15:02] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:02 | 200 |       0s |       127.0.0.1 | OPTIONS  "/dav/openlist-local"
[21:15:02] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:02 | 207 |       0s |       127.0.0.1 | PROPFIND  "/dav/openlist-local"
[21:15:14] [WARN] [openlist] failed get /openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt: failed to get obj: object not found
[21:15:14] [INFO] [openlist] ERRO[2026-09-10 21:15:14] HEAD /dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt object not found
[N/A] [INFO] [openlist] failed to get obj
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 404 |  506.1µs |       127.0.0.1 | HEAD     "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 201 |   1.59ms |       127.0.0.1 | PUT      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | HEAD     "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 207 |       0s |       127.0.0.1 | PROPFIND  "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 201 |  536.6µs |       127.0.0.1 | PUT      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | HEAD     "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 207 |       0s |       127.0.0.1 | PROPFIND  "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 201 |  533.1µs |       127.0.0.1 | PUT      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 201 |  529.4µs |       127.0.0.1 | PUT      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |  506.6µs |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | HEAD     "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 207 |       0s |       127.0.0.1 | PROPFIND  "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 201 |  533.1µs |       127.0.0.1 | PUT      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | HEAD     "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 207 |       0s |       127.0.0.1 | PROPFIND  "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 201 |    524µs |       127.0.0.1 | PUT      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 200 |       0s |       127.0.0.1 | GET      "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 204 |       0s |       127.0.0.1 | DELETE   "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"
[21:15:14] [WARN] [openlist] failed get /openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt: failed to get obj: object not found
[21:15:14] [INFO] [openlist] ERRO[2026-09-10 21:15:14] HEAD /dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt object not found
[N/A] [INFO] [openlist] failed to get obj
[21:15:14] [INFO] [openlist] [GIN] 2026/09/10 - 21:15:14 | 404 |       0s |       127.0.0.1 | HEAD     "/dav/openlist-local/webdav-etag-probe-70f944bf753142f28832e83e4fae2058.txt"

配置文件内容(必填)

irrelevant

复现链接(可选)

No response

AI生成内容

  • 我使用了AI工具生成此内容
  • 我没有使用AI工具生成此内容

AI模型是

gpt-5.6-sol

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions