Skip to content

Commit

Permalink
Fix OO save for a file without extension (#4330)
Browse files Browse the repository at this point in the history
1. An office document is shared
2. One user edits the document in OnlyOffice
3. Another user renames the file and change/remove the extension
4. The first user has finished editing the document

Here, OnlyOffice sends a callback to the stack to save the document. The
stack was responding with a 500 code as the file wasn't seen as an
office document. We should check that only when opening a document, not
for saving it.
  • Loading branch information
nono authored Feb 15, 2024
2 parents 19479ba + 7e539d1 commit 50ce195
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions model/office/callback.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package office is for interactions with an OnlyOffice server to allow users
// to view/edit their office documents online.
package office

import (
Expand Down Expand Up @@ -136,9 +138,6 @@ func saveFile(inst *instance.Instance, detector conflictDetector, downloadURL st
if err != nil {
return nil, err
}
if !isOfficeDocument(file) {
return nil, ErrInvalidFile
}

res, err := docserverClient.Get(downloadURL)
if err != nil {
Expand Down

0 comments on commit 50ce195

Please sign in to comment.