OpenListTeam / OpenListTeam/OpenList

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

Open
#3,065 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
24.7k
Forks
2.3k
Avg merge
1d 20h
Merged PRs (30d)
36

Description

请确认以下事项
  • 我已确认阅读并同意 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.1RFC9110 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,内容被覆盖 错误
覆盖已有文件时的状态码 200204 始终返回 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WebDAV PUT handling and its ETag and conditional-request processing, using the linked RFC 9110 sections as the behavioral reference. Reproduce the listed If-Match and If-None-Match cases with the local driver, then verify 412 responses, correct creation/update status codes, and changed ETags after modification.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.