diff --git a/changelog/unreleased/change-public-link-hash.md b/changelog/unreleased/change-public-link-hash.md new file mode 100644 index 0000000000..7b083922c2 --- /dev/null +++ b/changelog/unreleased/change-public-link-hash.md @@ -0,0 +1,7 @@ +Change: Remove hash from public link urls + +Public link urls do not contain the hash anymore, this is needed to support the ocis and web history mode. + +https://github.com/cs3org/reva/pull/2596 +https://github.com/owncloud/ocis/pull/3109 +https://github.com/owncloud/web/pull/6363 diff --git a/internal/http/services/owncloud/ocdav/ocdav.go b/internal/http/services/owncloud/ocdav/ocdav.go index fd1303e1a1..e925a645fb 100644 --- a/internal/http/services/owncloud/ocdav/ocdav.go +++ b/internal/http/services/owncloud/ocdav/ocdav.go @@ -229,8 +229,9 @@ func (s *svc) Handler() http.Handler { head, r.URL.Path = router.ShiftPath(r.URL.Path) if head == "s" { token := r.URL.Path - url := s.c.PublicURL + path.Join("#", head, token) - http.Redirect(w, r, url, http.StatusMovedPermanently) + rURL := s.c.PublicURL + path.Join(head, token) + + http.Redirect(w, r, rURL, http.StatusMovedPermanently) return } } diff --git a/internal/http/services/owncloud/ocs/conversions/main.go b/internal/http/services/owncloud/ocs/conversions/main.go index 450dd2f7e5..c8cb64e801 100644 --- a/internal/http/services/owncloud/ocs/conversions/main.go +++ b/internal/http/services/owncloud/ocs/conversions/main.go @@ -212,7 +212,7 @@ func PublicShare2ShareData(share *link.PublicShare, r *http.Request, publicURL s Token: share.Token, Name: share.DisplayName, MailSend: 0, - URL: publicURL + path.Join("/", "#/s/"+share.Token), + URL: publicURL + path.Join("/", "s/"+share.Token), UIDOwner: LocalUserIDToString(share.Creator), UIDFileOwner: LocalUserIDToString(share.Owner), }