Merge pull request #8209 from artoscinote/ma_SCI_11419

Fix WOPI action URL generation for Word vs Excell, PowerPoint [SCI-11419]
This commit is contained in:
Martin Artnik 2025-02-05 13:23:15 +01:00 committed by GitHub
commit bd093ca9c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -299,13 +299,13 @@ class Asset < ApplicationRecord
# Extract only the licenced user flag parameter
is_licenced_user = ENV['WOPI_BUSINESS_USERS'] == 'true' && action_url.include?('IsLicensedUser=BUSINESS_USER')
action_url = action_url.split(/[\&\?]</).first + "?IsLicencedUser=#{is_licenced_user ? 1 : 0}&"
action_url = action_url.split(/<.*>/).first + "IsLicencedUser=#{is_licenced_user ? 1 : 0}"
rest_url = Rails.application.routes.url_helpers.wopi_rest_endpoint_url(
host: ENV['WOPI_ENDPOINT_URL'],
id: id
)
action_url += "WOPISrc=#{rest_url}"
action_url += "&WOPISrc=#{rest_url}"
if with_tokens
token = user.get_wopi_token
action_url + "&access_token=#{token.token}"\