[GH-ISSUE #707] webdav 协议与 iris 播放器不兼容 #5946

Closed
opened 2026-05-29 23:48:58 +03:00 by zhus · 6 comments
Owner

Originally created by @EdenHell on GitHub (May 19, 2026).
Original GitHub issue: https://github.com/sigoden/dufs/issues/707

Problem

windows 某网盘播放器 iris 播放器 不能使用 dufs 作为后端存储 (webdav 协议)。
不过 kodi 能使用 dufs 作为后端,可一定程度排除服务端配置问题

Configuration

serve-path: '/data'
port: 5000
auth:
  - share:xxxxxxxx@/Movie,/TV series
allow-all: false
allow-upload: true
allow-delete: false
allow-search: true
allow-archive: true
enable-cors: true
render-try-index: false

Log

呃,忘记抓了

Screenshots/Media

参考 https://github.com/nini22P/iris/issues/74

Environment Information

  • Dufs version: 0.46.0
  • Browser/Webdav info: iris 播放器
  • OS info: widnows 11
Originally created by @EdenHell on GitHub (May 19, 2026). Original GitHub issue: https://github.com/sigoden/dufs/issues/707 **Problem** windows 某网盘播放器 [iris 播放器](https://github.com/nini22P/iris) 不能使用 dufs 作为后端存储 (webdav 协议)。 不过 kodi 能使用 dufs 作为后端,可一定程度排除服务端配置问题 **Configuration** ``` serve-path: '/data' port: 5000 auth: - share:xxxxxxxx@/Movie,/TV series allow-all: false allow-upload: true allow-delete: false allow-search: true allow-archive: true enable-cors: true render-try-index: false ``` **Log** 呃,忘记抓了 **Screenshots/Media** 参考 https://github.com/nini22P/iris/issues/74 **Environment Information** - Dufs version: 0.46.0 - Browser/Webdav info: [iris 播放器](https://github.com/nini22P/iris) - OS info: widnows 11
zhus closed this issue 2026-05-29 23:48:58 +03:00
Author
Owner

@EdenHell commented on GitHub (May 19, 2026):

我服务端换成用 https://github.com/hacdias/webdav 是没这个问题的。是否各服务端实现的 webdav 协议略有差别?

<!-- gh-comment-id:4488041617 --> @EdenHell commented on GitHub (May 19, 2026): 我服务端换成用 https://github.com/hacdias/webdav 是没这个问题的。是否各服务端实现的 webdav 协议略有差别?
Author
Owner

@sigoden commented on GitHub (May 20, 2026):

I just tried it and didn't find any problems.

Image
<!-- gh-comment-id:4493535343 --> @sigoden commented on GitHub (May 20, 2026): I just tried it and didn't find any problems. <img width="2654" height="1908" alt="Image" src="https://github.com/user-attachments/assets/f419b01f-9a97-43ea-87ba-238916d31bf1" />
Author
Owner

@EdenHell commented on GitHub (May 20, 2026):

差点就尴尬了,我重新复现了下,开了日志,抓了下包。貌似是因为 iris 播放器测试的时候使用 PROPFIND 请求 / 路径,且不带用户认证信息。而且我修改配置允许匿名访问后就没有问题。以下是日志和抓包信息:

dufs 日志:
Image

抓包:
Image

看起来某些 webdav 实现允许这种请求。

@sigoden

<!-- gh-comment-id:4494008190 --> @EdenHell commented on GitHub (May 20, 2026): 差点就尴尬了,我重新复现了下,开了日志,抓了下包。貌似是因为 iris 播放器测试的时候使用 PROPFIND 请求 / 路径,且不带用户认证信息。而且我修改配置允许匿名访问后就没有问题。以下是日志和抓包信息: dufs 日志: <img width="2035" height="195" alt="Image" src="https://github.com/user-attachments/assets/16806132-4802-4bdc-921f-9f9dd456fc04" /> 抓包: <img width="2542" height="1865" alt="Image" src="https://github.com/user-attachments/assets/68a685b5-e422-4fe1-9c56-f039aeb1183e" /> 看起来某些 webdav 实现允许这种请求。 @sigoden
Author
Owner

@EdenHell commented on GitHub (May 20, 2026):

或许可以考虑增加配置项来支持这种行为

<!-- gh-comment-id:4494070930 --> @EdenHell commented on GitHub (May 20, 2026): 或许可以考虑增加配置项来支持这种行为
Author
Owner

@sigoden commented on GitHub (May 20, 2026):

When dufs encounters a 401 error, it will respond with two www-authenticate headers. Some WebDAV clients do not support multiple www-authenticate headers, which may be the cause of the problem.

$ curl -i -X PROPFIND localhost:5000
HTTP/1.1 401 Unauthorized
allow: GET,HEAD,PUT,OPTIONS,DELETE,PATCH,PROPFIND,COPY,MOVE,CHECKAUTH,LOGOUT
dav: 1, 2, 3
www-authenticate: Digest realm="DUFS", nonce="6a0d230f44967ea1a7855a7fc70c4aada3", qop="auth"
www-authenticate: Basic realm="DUFS"
content-length: 0
date: Wed, 20 May 2026 02:57:19 GMT

This is a problem that the WebDAV client needs to solve.

<!-- gh-comment-id:4494105965 --> @sigoden commented on GitHub (May 20, 2026): When dufs encounters a 401 error, it will respond with two www-authenticate headers. Some WebDAV clients do not support multiple www-authenticate headers, which may be the cause of the problem. ``` $ curl -i -X PROPFIND localhost:5000 HTTP/1.1 401 Unauthorized allow: GET,HEAD,PUT,OPTIONS,DELETE,PATCH,PROPFIND,COPY,MOVE,CHECKAUTH,LOGOUT dav: 1, 2, 3 www-authenticate: Digest realm="DUFS", nonce="6a0d230f44967ea1a7855a7fc70c4aada3", qop="auth" www-authenticate: Basic realm="DUFS" content-length: 0 date: Wed, 20 May 2026 02:57:19 GMT ``` This is a problem that the WebDAV client needs to solve.
Author
Owner

@EdenHell commented on GitHub (May 20, 2026):

哦哦,原来如此,首次 401 请求是正常的,会返回需要的认证信息。你说的对,我现在用的 webdav 确实只返回了一个 www-authenticate

Hypertext Transfer Protocol
    HTTP/1.1 401 Unauthorized\r\n
    Content-Type: text/plain; charset=utf-8\r\n
    Vary: Origin\r\n
    Www-Authenticate: Basic realm="Restricted"\r\n
    X-Content-Type-Options: nosniff\r\n
    Date: Wed, 20 May 2026 03:23:07 GMT\r\n
    Content-Length: 15\r\n
    \r\n
    [Request in frame: 1584]
    [Time since request: 50.414400 milliseconds]
    [Request URI: /]
    [Full request URI: http://xxxxxx.com:9091/]
    File Data: 15 bytes
Line-based text data: text/plain (1 lines)
    Not authorized\n

@sigoden

<!-- gh-comment-id:4494224723 --> @EdenHell commented on GitHub (May 20, 2026): 哦哦,原来如此,首次 401 请求是正常的,会返回需要的认证信息。你说的对,我现在用的 [webdav](https://github.com/hacdias/webdav) 确实只返回了一个 www-authenticate ``` Hypertext Transfer Protocol HTTP/1.1 401 Unauthorized\r\n Content-Type: text/plain; charset=utf-8\r\n Vary: Origin\r\n Www-Authenticate: Basic realm="Restricted"\r\n X-Content-Type-Options: nosniff\r\n Date: Wed, 20 May 2026 03:23:07 GMT\r\n Content-Length: 15\r\n \r\n [Request in frame: 1584] [Time since request: 50.414400 milliseconds] [Request URI: /] [Full request URI: http://xxxxxx.com:9091/] File Data: 15 bytes Line-based text data: text/plain (1 lines) Not authorized\n ``` @sigoden
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#5946