Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e3d1633a
Commit
e3d1633a
authored
Sep 03, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont allow html render for RAW view
parent
6c1c2842
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
app/controllers/projects/raw_controller.rb
app/controllers/projects/raw_controller.rb
+9
-1
No files found.
app/controllers/projects/raw_controller.rb
View file @
e3d1633a
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment