Add user file editor endpoint and enhance WOPI handlers with logging
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user