Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get rid of public link url hash #2596

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
}
}
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),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
URL: publicURL + path.Join("/", "s/"+share.Token),
URL: publicURL + path.Join("/", "s", share.Token),

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, this fails in CI and is not that important. keep it like it is.

UIDOwner: LocalUserIDToString(share.Creator),
UIDFileOwner: LocalUserIDToString(share.Owner),
}
Expand Down