Remove invalid custom HTTP client - use query parameter token for SfPdfViewer
This commit is contained in:
BIN
go_cloud/api
BIN
go_cloud/api
Binary file not shown.
@@ -459,8 +459,7 @@ func viewerHandler(w http.ResponseWriter, r *http.Request, db *database.DB, jwtM
|
||||
errors.WriteError(w, errors.CodeInternal, "Server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// Download URL without token - will use Authorization header instead
|
||||
downloadPath := fmt.Sprintf("%s://%s/orgs/%s/files/download?path=%s", scheme, host, orgID.String(), url.QueryEscape(file.Path))
|
||||
downloadPath := fmt.Sprintf("%s://%s/orgs/%s/files/download?path=%s&token=%s", scheme, host, orgID.String(), url.QueryEscape(file.Path), url.QueryEscape(viewerToken))
|
||||
|
||||
// Determine if it's a PDF based on file extension
|
||||
isPdf := strings.HasSuffix(strings.ToLower(file.Name), ".pdf")
|
||||
@@ -543,8 +542,7 @@ func userViewerHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
|
||||
errors.WriteError(w, errors.CodeInternal, "Server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// Download URL without token - will use Authorization header instead
|
||||
downloadPath := fmt.Sprintf("%s://%s/user/files/download?path=%s", scheme, host, url.QueryEscape(file.Path))
|
||||
downloadPath := fmt.Sprintf("%s://%s/user/files/download?path=%s&token=%s", scheme, host, url.QueryEscape(file.Path), url.QueryEscape(viewerToken))
|
||||
|
||||
// Determine if it's a PDF based on file extension
|
||||
isPdf := strings.HasSuffix(strings.ToLower(file.Name), ".pdf")
|
||||
|
||||
Reference in New Issue
Block a user