mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
Fix fetching of WOPI discovery document [SCI-8889] (#5803)
This commit is contained in:
parent
eb37a68f27
commit
8b47982ccc
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue