Add debug logging for WOPI handlers and include access token in WOPISrc URL
This commit is contained in:
BIN
go_cloud/api
BIN
go_cloud/api
Binary file not shown.
@@ -340,6 +340,7 @@ func wopiGetFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
|
||||
|
||||
// Get access token from query parameter
|
||||
accessToken := r.URL.Query().Get("access_token")
|
||||
fmt.Printf("[WOPI-GetFile] Access token from query: '%s'\n", accessToken)
|
||||
if accessToken == "" {
|
||||
errors.WriteError(w, errors.CodeUnauthenticated, "Missing access_token", http.StatusUnauthorized)
|
||||
return
|
||||
@@ -533,10 +534,11 @@ func wopiPutFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
|
||||
return
|
||||
}
|
||||
defer r.Body.Close()
|
||||
|
||||
fmt.Printf("[WOPI-STORAGE] Read content: %d bytes\n", len(content))
|
||||
// Check for suggested target (used for export operations like Save as PDF)
|
||||
suggestedTarget := r.Header.Get("X-WOPI-SuggestedTarget")
|
||||
isExport := suggestedTarget != ""
|
||||
fmt.Printf("[WOPI-PutFile] Suggested target: '%s', isExport: %v\n", suggestedTarget, isExport)
|
||||
|
||||
var targetFile *database.File
|
||||
var targetRemotePath string
|
||||
@@ -846,8 +848,10 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
|
||||
return
|
||||
}
|
||||
|
||||
// Build WOPISrc URL (without access_token - that goes in a separate form field)
|
||||
wopiSrc := fmt.Sprintf("https://go.b0esche.cloud/wopi/files/%s", fileID)
|
||||
fmt.Printf("[COLLABORA-PROXY] Generated access token: %s\n", accessToken)
|
||||
|
||||
// Build WOPISrc URL (with access_token as query parameter)
|
||||
wopiSrc := fmt.Sprintf("https://go.b0esche.cloud/wopi/files/%s?access_token=%s", fileID, url.QueryEscape(accessToken))
|
||||
|
||||
// Get the correct Collabora editor URL from discovery (includes version hash)
|
||||
editorURL := getCollaboraEditorURL(collaboraURL)
|
||||
|
||||
Reference in New Issue
Block a user