Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
get rid of public link url hash (cs3org#2596)
Browse files Browse the repository at this point in the history
  • Loading branch information
fschade authored and ishank011 committed Mar 10, 2022
1 parent cfaba1a commit e9c47e2
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 @@ -228,8 +228,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 e9c47e2

Please sign in to comment.