diff options
Diffstat (limited to 'app/controllers/admin/requests_profiles_controller.rb')
-rw-r--r-- | app/controllers/admin/requests_profiles_controller.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/admin/requests_profiles_controller.rb b/app/controllers/admin/requests_profiles_controller.rb index 89d4c4f18d9..24383455064 100644 --- a/app/controllers/admin/requests_profiles_controller.rb +++ b/app/controllers/admin/requests_profiles_controller.rb @@ -3,17 +3,17 @@ class Admin::RequestsProfilesController < Admin::ApplicationController def index @profile_token = Gitlab::RequestProfiler.profile_token - @profiles = Gitlab::RequestProfiler::Profile.all.group_by(&:request_path) + @profiles = Gitlab::RequestProfiler.all.group_by(&:request_path) end def show clean_name = Rack::Utils.clean_path_info(params[:name]) - profile = Gitlab::RequestProfiler::Profile.find(clean_name) + profile = Gitlab::RequestProfiler.find(clean_name) - if profile - render html: profile.content.html_safe - else - redirect_to admin_requests_profiles_path, alert: 'Profile not found' + unless profile && profile.content_type + return redirect_to admin_requests_profiles_path, alert: 'Profile not found' end + + send_file profile.file_path, type: "#{profile.content_type}; charset=utf-8", disposition: 'inline' end end |