hacdias / webdav

A simple and standalone WebDAV server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"modify: false" doesn't work?

CatSamaDD opened this issue · comments

users:

  • username: user
    password: "123456"
    scope: /data
    modify: false

Sorry for my poor English.
When I set “modify: false” , I can connect my webdav server,but I can still create ,edit , delete files .
What I want is all the "/data" is readonly.
What should I do? Thanks.

the only different between "modify: false“ and "modify: true" is I can't create folder when I set "modify: false“

It's so strange, the modification methods are marked as noModification...

webdav/lib/webdav.go

Lines 110 to 118 in 8a8650d

noModification := r.Method == "GET" ||
r.Method == "HEAD" ||
r.Method == "OPTIONS" ||
r.Method == "PROPFIND" ||
r.Method == "PUT" ||
r.Method == "LOCK" ||
r.Method == "UNLOCK" ||
r.Method == "MOVE" ||
r.Method == "DELETE"

It's so strange, the modification methods are marked as noModification...

webdav/lib/webdav.go

Lines 110 to 118 in 8a8650d

noModification := r.Method == "GET" ||
r.Method == "HEAD" ||
r.Method == "OPTIONS" ||
r.Method == "PROPFIND" ||
r.Method == "PUT" ||
r.Method == "LOCK" ||
r.Method == "UNLOCK" ||
r.Method == "MOVE" ||
r.Method == "DELETE"

I suspected that code is wrong in my local copy, and we discussed it briefly on this commit:

9a4b378#comments

I'm quite busy during this time and won't get around to shooting a fix soon. Anyone is free to shoot the PR, and I'll gladly review it and merge it.

Has this been addressed in the docker version?

The latest commits with the fix (#104) is now released.