fix: fix date formatting

This commit is contained in:
Juan Pablo Villafáñez
2024-12-10 10:21:08 +01:00
parent 4e509605f7
commit 2e3f21afbb
2 changed files with 4 additions and 2 deletions

View File

@@ -7,5 +7,7 @@ const (
ContextKeyPath
// RFC1123 time that mimics oc10. time.RFC1123 would end in "UTC", see https://github.com/golang/go/issues/13781
// Format copied from internal package https://github.com/cs3org/reva/blob/edge/internal/http/services/owncloud/ocdav/net/net.go.
// It's needed to match the times shown in PROPFIND and REPORT requests.
RFC1123 = "Mon, 02 Jan 2006 15:04:05 GMT"
)

View File

@@ -9,7 +9,6 @@ import (
"path"
"strconv"
"strings"
"time"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
merrors "go-micro.dev/v4/errors"
@@ -21,6 +20,7 @@ import (
"github.com/cs3org/reva/v2/pkg/utils"
searchmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/search/v0"
searchsvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0"
"github.com/owncloud/ocis/v2/services/webdav/pkg/constants"
"github.com/owncloud/ocis/v2/services/webdav/pkg/net"
"github.com/owncloud/ocis/v2/services/webdav/pkg/prop"
"github.com/owncloud/ocis/v2/services/webdav/pkg/propfind"
@@ -192,7 +192,7 @@ func matchToPropResponse(ctx context.Context, match *searchmsg.Match) (*propfind
})))
}
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:name", match.Entity.Name))
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getlastmodified", match.Entity.LastModifiedTime.AsTime().Format(time.RFC1123)))
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getlastmodified", match.Entity.LastModifiedTime.AsTime().Format(constants.RFC1123)))
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getcontenttype", match.Entity.MimeType))
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:permissions", match.Entity.Permissions))
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:highlights", match.Entity.Highlights))