Skip to content

Commit

Permalink
fix(public-share-auth): allow to create new documents in public share…
Browse files Browse the repository at this point in the history
… folder

The public share authentication middleware only allowed to open existing documents
the /app/new route was missing.

Fixes #8691
  • Loading branch information
rhafer committed Apr 15, 2024
1 parent f0089bc commit 8d5a0c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions changelog/unreleased/fix-adding-wopi-doc-on-public-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Fix creating new WOPI documents on public shares

Creating a new Office document in a publicly shared folder is now possible.

https://github.com/owncloud/ocis/pull/8828
https://github.com/owncloud/ocis/issues/8691

2 changes: 1 addition & 1 deletion services/proxy/pkg/middleware/public_share_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func isPublicShareArchive(r *http.Request) bool {
// The app open requests can also be made in authenticated context. In these cases the PublicShareAuthenticator
// needs to ignore the request.
func isPublicShareAppOpen(r *http.Request) bool {
return strings.HasPrefix(r.URL.Path, "/app/open") &&
return (strings.HasPrefix(r.URL.Path, "/app/open") || strings.HasPrefix(r.URL.Path, "/app/new")) &&
(r.URL.Query().Get(headerShareToken) != "" || r.Header.Get(headerShareToken) != "")
}

Expand Down

0 comments on commit 8d5a0c6

Please sign in to comment.