-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/webdav: missing "getlastmodified" on directories #15334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmm... I can't remember if that's a WebDAV spec thing. Perhaps @rsto or @davecheney have an opinion. |
That's intentional. net/webdav doesn't support GET on directories but the WebDAV spec expects the getlastmodified property to only be defined for GETable resources (see here). That's the reason why all the DAV:get* properties in prop.go are disabled for directories. Is this causing issues with a WebDAV client? |
No, it's not causing any problem at all. I just see the modtimes of all directories as unix epoch and I wondered why. Thanks for the clarification. |
Hey again, I've thought about this issue at length and it feels wrong that folders (collection) do not supposed to have mtime. I've looked at nginx and apache, and they both send 'getlastmodified' live property for the folders I stat. Missing 'getlastmodified' for folders prevents clients to sort all files and folders correctly, since they all have the same mtime, which is Unix epoch. What do you think? Not a concrete clue but just for the sake of reference: nginx webdav module: https://github.com/arut/nginx-dav-ext-module/blob/master/ngx_http_dav_ext_module.c#L374 apache webdav module: https://github.com/apache/httpd/blob/8322599c746bbdf1410a098a5d4764499baf7670/modules/dav/fs/repos.c#L1959 |
I was not aware of any client issues around getlastmodified. Do you know which clients are affected? If there are real issues, I agree that net/webdav should support this use case, even if it deviates from the RFC. Returning this property for directories most probably won't break properly implemented clients anyways (but that's just me guessing). |
I'm testing it with Cyberduck, Cadaver and Kodi. Try to sort folders by date, and they will sort by name because folders have the same modified-date since they don't have 'getlastmodified' property at all. |
If you send a patch I'll be happy to review it. It's @nigeltao, who decides if the change gets accepted. |
CL https://golang.org/cl/23422 mentions this issue. |
Do apache and nginx honor a GET request on directories? If so, what's the response body? |
WebDAV clients can't sort folders by date because 'getlastmodified' live property is not set. Fixes golang/go#15334. Change-Id: Ie56fcf8ae98173878e0972c0f9401151953334ff Reviewed-on: https://go-review.googlesource.com/23422 Reviewed-by: Nigel Tao <nigeltao@golang.org>
I'm using go 1.6, x/net/webdav: golang/net@d75b190
goenv: GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/ibrahim" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GO15VENDOREXPERIMENT="1" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common" CXX="clang++" CGO_ENABLED="1"
"getlastmodified" live property is off by default for directories. Is that intentional, or a webdav spec thing?
https://github.com/golang/net/blob/master/webdav/prop.go#L121
// CC: @nigeltao
The text was updated successfully, but these errors were encountered: