fix(public-share-auth): allow to create new documents in public share folder

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

Fixes #8691
This commit is contained in:
Ralf Haferkamp
2024-04-10 18:22:43 +02:00
committed by Ralf Haferkamp
parent f0089bc1cc
commit 8d5a0c6dd8
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -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) != "")
}