Fix fetching of WOPI discovery document [SCI-8889] (#5803)

This commit is contained in:
Alex Kriuchykhin 2023-07-18 15:25:04 +02:00 committed by GitHub
parent eb37a68f27
commit 8b47982ccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ module WopiUtil
# Currently only saves Excel, Word and PowerPoint view and edit actions # Currently only saves Excel, Word and PowerPoint view and edit actions
def initialize_discovery def initialize_discovery
Rails.cache.fetch(:wopi_discovery, expires_in: DISCOVERY_TTL) do Rails.cache.fetch(:wopi_discovery, expires_in: DISCOVERY_TTL) do
@doc = Nokogiri::XML(Kernel.open(ENV['WOPI_DISCOVERY_URL'])) @doc = Nokogiri::XML(Net::HTTP.get(URI(ENV.fetch('WOPI_DISCOVERY_URL', nil))))
discovery_json = {} discovery_json = {}
key = @doc.xpath('//proof-key') key = @doc.xpath('//proof-key')
discovery_json[:proof_key_mod] = key.xpath('@modulus').first.value discovery_json[:proof_key_mod] = key.xpath('@modulus').first.value