Skip to content

Commit

Permalink
Merge pull request #3895 from dragonchaser/issue-5442-missing-expiry-…
Browse files Browse the repository at this point in the history
…in-shares

Add missing expiry in shares
  • Loading branch information
dragonchaser committed May 17, 2023
2 parents 2bd4810 + 9305e33 commit de5cc4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-missing-expiry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Add missing expiry date to shares

We have added expiry dates to the shares

https://github.com/cs3org/reva/pull/3895
https://github.com/owncloud/ocis/issues/5442
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,19 @@ func (h *Handler) createCs3Share(ctx context.Context, w http.ResponseWriter, r *
}
}

expiry := r.PostFormValue("expireDate")
if expiry != "" {
ts, err := time.Parse("2006-01-02T15:04:05-0700", expiry)
if err != nil {
return nil, &ocsError{
Code: response.MetaBadRequest.StatusCode,
Message: "could not parse expiry timestamp on this item",
Error: err,
}
}
req.Grant.Expiration = utils.TimeToTS(ts)
}

createShareResponse, err := client.CreateShare(ctx, req)
if err != nil {
return nil, &ocsError{
Expand Down

0 comments on commit de5cc4a

Please sign in to comment.