Skip to content
Snippets Groups Projects
Commit e3d1633a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Dont allow html render for RAW view

parent 6c1c2842
No related branches found
No related tags found
1 merge request!4948CentOS 6.4 install GitLab 6 0 stable ssh Auth fail
Loading
Loading
@@ -11,9 +11,17 @@ class Projects::RawController < Projects::ApplicationController
@blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path)
 
if @blob.exists?
type = if @blob.mime_type =~ /html|javascript/
'text/plain; charset=utf-8'
else
@blob.mime_type
end
headers['X-Content-Type-Options'] = 'nosniff'
send_data(
@blob.data,
type: @blob.mime_type,
type: type,
disposition: 'inline',
filename: @blob.name
)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment