Skip to content

Commit

Permalink
get rid of public link url hash (#2596) (#2615)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Schade <f.schade@icloud.com>
  • Loading branch information
ishank011 and fschade authored Mar 7, 2022
1 parent ee9653f commit d043e9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/change-public-link-hash.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions internal/http/services/owncloud/ocdav/ocdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,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
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocs/conversions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down

0 comments on commit d043e9d

Please sign in to comment.