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

(cherry picked from commit 8d5a0c6dd8)
This commit is contained in:
Ralf Haferkamp
2024-04-17 12:22:24 +02:00
parent 43f190be4d
commit 6df5f45c0e
2 changed files with 8 additions and 1 deletions
@@ -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) != "")
}