diff --git a/changelog/unreleased/fix-adding-wopi-doc-on-public-share.md b/changelog/unreleased/fix-adding-wopi-doc-on-public-share.md new file mode 100644 index 00000000000..5c901ab5533 --- /dev/null +++ b/changelog/unreleased/fix-adding-wopi-doc-on-public-share.md @@ -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 + diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index f66e030a006..403d5d598bb 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -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) != "") }