Add user file editor endpoint and enhance WOPI handlers with logging

This commit is contained in:
Leon Bösche
2026-01-14 12:09:25 +01:00
parent aea5ba9e58
commit de720cbdcb
2 changed files with 64 additions and 9 deletions

View File

@@ -245,6 +245,8 @@ func wopiCheckFileInfoHandler(w http.ResponseWriter, r *http.Request, db *databa
return
}
fmt.Printf("[WOPI-CheckFileInfo] START: file=%s user=%s size=%d path=%s\n", fileID, userID.String(), file.Size, file.Path)
// Verify user has access to this file
canAccess := false
var ownerID string
@@ -313,6 +315,8 @@ func wopiGetFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
return
}
fmt.Printf("[WOPI-GetFile] START: file=%s\n", fileID)
// Get access token from query parameter
accessToken := r.URL.Query().Get("access_token")
if accessToken == "" {
@@ -393,6 +397,8 @@ func wopiGetFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
}
defer resp.Body.Close()
fmt.Printf("[WOPI-STORAGE] Download response status: %d\n", resp.StatusCode)
// Set response headers
contentType := getMimeType(file.Name)
w.Header().Set("Content-Type", contentType)