[GH-ISSUE #137] 同时配置 --path-prefix 和 --auth 以后,无法认证 #64

Closed
opened 2026-04-08 16:50:09 +03:00 by zhus · 0 comments
Owner

Originally created by @moesnow on GitHub (Oct 7, 2022).
Original GitHub issue: https://github.com/sigoden/dufs/issues/137

Problem

同时配置 --path-prefix 和 --auth 以后,无法认证
Curl始终提示401 Unauthorized
浏览器访问也是一样,表现为弹出账户密码输入框,提交后再次弹出
不清楚是不是我哪里设置有问题

Log

➜  ~ dufs -V
dufs 0.30.0
➜  ~ touch 1.txt

➜  ~ dufs -p 80 --path-prefix path -a '/@admin:admin@*'
➜  ~ curl http://127.0.0.1:80/path/1.txt -I
HTTP/1.1 401 Unauthorized
allow: GET,HEAD,PUT,OPTIONS,DELETE,PROPFIND,COPY,MOVE
dav: 1,2
connection: close
www-authenticate: Digest realm="DUFS",nonce="634047d47dc4b87bbce71a94b578d2ccad",qop="auth"
date: Fri, 07 Oct 2022 15:37:56 GMT

➜  ~ dufs -p 80 -a '/@admin:admin@*'
➜  ~ curl http://127.0.0.1:80/1.txt -I     
HTTP/1.1 200 OK
last-modified: Fri, 07 Oct 2022 15:37:03 GMT
etag: "1665157023736-0"
content-type: text/plain
content-disposition: inline; filename="1.txt"
accept-ranges: bytes
content-length: 0
date: Fri, 07 Oct 2022 15:37:40 GMT

➜  ~ dufs -p 80 --path-prefix path -a '/@admin:admin' --auth-method basic
➜  ~ curl http://127.0.0.1:80/path/1.txt -I --user admin:admin
HTTP/1.1 401 Unauthorized
allow: GET,HEAD,PUT,OPTIONS,DELETE,PROPFIND,COPY,MOVE
dav: 1,2
connection: close
www-authenticate: Basic realm="DUFS"
date: Fri, 07 Oct 2022 15:40:55 GMT

➜  ~ dufs -p 80 -a '/@admin:admin' --auth-method basic
➜  ~ curl http://127.0.0.1:80/1.txt -I --user admin:admin
HTTP/1.1 200 OK
last-modified: Fri, 07 Oct 2022 15:37:03 GMT
etag: "1665157023736-0"
content-type: text/plain
content-disposition: inline; filename="1.txt"
accept-ranges: bytes
content-length: 0
date: Fri, 07 Oct 2022 15:40:20 GMT

Environment:

  • Dufs version: 0.30.0
  • Browser/Webdav Info: Curl
  • OS Info: macOS
Originally created by @moesnow on GitHub (Oct 7, 2022). Original GitHub issue: https://github.com/sigoden/dufs/issues/137 **Problem** 同时配置 --path-prefix 和 --auth 以后,无法认证 Curl始终提示401 Unauthorized 浏览器访问也是一样,表现为弹出账户密码输入框,提交后再次弹出 不清楚是不是我哪里设置有问题 **Log** ``` ➜ ~ dufs -V dufs 0.30.0 ➜ ~ touch 1.txt ➜ ~ dufs -p 80 --path-prefix path -a '/@admin:admin@*' ➜ ~ curl http://127.0.0.1:80/path/1.txt -I HTTP/1.1 401 Unauthorized allow: GET,HEAD,PUT,OPTIONS,DELETE,PROPFIND,COPY,MOVE dav: 1,2 connection: close www-authenticate: Digest realm="DUFS",nonce="634047d47dc4b87bbce71a94b578d2ccad",qop="auth" date: Fri, 07 Oct 2022 15:37:56 GMT ➜ ~ dufs -p 80 -a '/@admin:admin@*' ➜ ~ curl http://127.0.0.1:80/1.txt -I HTTP/1.1 200 OK last-modified: Fri, 07 Oct 2022 15:37:03 GMT etag: "1665157023736-0" content-type: text/plain content-disposition: inline; filename="1.txt" accept-ranges: bytes content-length: 0 date: Fri, 07 Oct 2022 15:37:40 GMT ➜ ~ dufs -p 80 --path-prefix path -a '/@admin:admin' --auth-method basic ➜ ~ curl http://127.0.0.1:80/path/1.txt -I --user admin:admin HTTP/1.1 401 Unauthorized allow: GET,HEAD,PUT,OPTIONS,DELETE,PROPFIND,COPY,MOVE dav: 1,2 connection: close www-authenticate: Basic realm="DUFS" date: Fri, 07 Oct 2022 15:40:55 GMT ➜ ~ dufs -p 80 -a '/@admin:admin' --auth-method basic ➜ ~ curl http://127.0.0.1:80/1.txt -I --user admin:admin HTTP/1.1 200 OK last-modified: Fri, 07 Oct 2022 15:37:03 GMT etag: "1665157023736-0" content-type: text/plain content-disposition: inline; filename="1.txt" accept-ranges: bytes content-length: 0 date: Fri, 07 Oct 2022 15:40:20 GMT ``` **Environment:** - Dufs version: 0.30.0 - Browser/Webdav Info: Curl - OS Info: macOS
zhus closed this issue 2026-04-08 16:50:09 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#64