micromata / dave

A totally simple and very easy to configure stand alone webdav server
Apache License 2.0
350 stars 46 forks source link

Clients expecting response/propstat/prop/creationdate #25

Closed jwise-mfg closed 1 year ago

jwise-mfg commented 3 years ago

Would it be possible to implement the creationdate prop element? Its a peer element to getlastmodified, and apparently suggested RFC4437. Not a huge deal (and I actually don't see it in the RFC) but I'm working with an older client that crashed because it was missing (I patched this particular client, but others may have trouble.)

Thanks for building this, its awesome!

jwise-mfg commented 3 years ago

Sample code... but it looks like this is a Windows-only feature 👎 in props.go > liveProps

    {Space: "DAV:", Local: "creationdate"}: {
        findFn: findCreationDate,
        dir:    false,
    },

and as a new method in the same file

func findCreationDate(ctx context.Context, fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {
    d := fi.Sys().(*syscall.Win32FileAttributeData)
    cTime = time.Unix(0, d.CreationTime.Nanoseconds())
    return fi.CreateTime().UTC().Format(http.TimeFormat), nil
}

Sorry, I'm new to Go, so you probably don't want my advice 😄

chclaus commented 3 years ago

Hi,

thanks for the information and thanks for the thanks. ;)

Unfortunately the potentially changes you mentioned comes directly from the golang webdav standard library (props.go comes from golang.org/x/net/webdav) which is instrumented by dave. I see no lightweight possibility to enable more webdav features than given by the library.

Sorry for that.