Merge pull request #3355 from okriuchykhin/ok_SCI_5768

Fix files download URLs in PDF report [SCI-5768]
This commit is contained in:
Alex Kriuchykhin 2021-05-27 14:30:50 +02:00 committed by GitHub
commit 1a16fcd6c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,7 @@ module Reports
ActionController::Renderer::RACK_KEY_TRANSLATION['warden'] ||= 'warden'
proxy = Warden::Proxy.new({}, Warden::Manager.new({}))
proxy.set_user(user, scope: :user, store: false)
ApplicationController.renderer.defaults[:http_host] = Rails.application.routes.default_url_options[:host]
renderer = ApplicationController.renderer.new(warden: proxy)
file << renderer.render(