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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
8346dde0
Commit
8346dde0
authored
Oct 09, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only render 404 page from /public
parent
fb8f604f
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
21 additions
and
24 deletions
+21
-24
CHANGELOG
CHANGELOG
+1
-0
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-5
app/controllers/import/bitbucket_controller.rb
app/controllers/import/bitbucket_controller.rb
+1
-1
app/controllers/import/fogbugz_controller.rb
app/controllers/import/fogbugz_controller.rb
+1
-1
app/controllers/import/github_controller.rb
app/controllers/import/github_controller.rb
+1
-1
app/controllers/import/gitlab_controller.rb
app/controllers/import/gitlab_controller.rb
+1
-1
app/controllers/import/gitorious_controller.rb
app/controllers/import/gitorious_controller.rb
+1
-1
app/controllers/import/google_code_controller.rb
app/controllers/import/google_code_controller.rb
+1
-1
app/controllers/projects/avatars_controller.rb
app/controllers/projects/avatars_controller.rb
+1
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+3
-3
app/controllers/projects/raw_controller.rb
app/controllers/projects/raw_controller.rb
+1
-1
app/controllers/projects/tree_controller.rb
app/controllers/projects/tree_controller.rb
+3
-3
app/controllers/projects/uploads_controller.rb
app/controllers/projects/uploads_controller.rb
+1
-1
app/controllers/uploads_controller.rb
app/controllers/uploads_controller.rb
+3
-3
lib/extracts_path.rb
lib/extracts_path.rb
+1
-1
No files found.
CHANGELOG
View file @
8346dde0
...
@@ -47,6 +47,7 @@ v 8.1.0 (unreleased)
...
@@ -47,6 +47,7 @@ v 8.1.0 (unreleased)
- Persist filters when sorting on admin user page (Jerry Lukins)
- Persist filters when sorting on admin user page (Jerry Lukins)
- Add spellcheck=false to certain input fields
- Add spellcheck=false to certain input fields
- Invalidate stored service password if the endpoint URL is changed
- Invalidate stored service password if the endpoint URL is changed
- Only render 404 page from /public
v 8.0.4
v 8.0.4
- Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu)
- Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu)
...
...
app/controllers/application_controller.rb
View file @
8346dde0
...
@@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base
...
@@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base
rescue_from
ActiveRecord
::
RecordNotFound
do
|
exception
|
rescue_from
ActiveRecord
::
RecordNotFound
do
|
exception
|
log_exception
(
exception
)
log_exception
(
exception
)
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
render
_
404
end
end
protected
protected
...
@@ -149,10 +149,6 @@ class ApplicationController < ActionController::Base
...
@@ -149,10 +149,6 @@ class ApplicationController < ActionController::Base
render
"errors/access_denied"
,
layout:
"errors"
,
status:
404
render
"errors/access_denied"
,
layout:
"errors"
,
status:
404
end
end
def
not_found!
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
end
def
git_not_found!
def
git_not_found!
render
"errors/git_not_found"
,
layout:
"errors"
,
status:
404
render
"errors/git_not_found"
,
layout:
"errors"
,
status:
404
end
end
...
...
app/controllers/import/bitbucket_controller.rb
View file @
8346dde0
...
@@ -62,7 +62,7 @@ class Import::BitbucketController < Import::BaseController
...
@@ -62,7 +62,7 @@ class Import::BitbucketController < Import::BaseController
end
end
def
verify_bitbucket_import_enabled
def
verify_bitbucket_import_enabled
not_found!
unless
bitbucket_import_enabled?
render_404
unless
bitbucket_import_enabled?
end
end
def
bitbucket_auth
def
bitbucket_auth
...
...
app/controllers/import/fogbugz_controller.rb
View file @
8346dde0
...
@@ -99,6 +99,6 @@ class Import::FogbugzController < Import::BaseController
...
@@ -99,6 +99,6 @@ class Import::FogbugzController < Import::BaseController
end
end
def
verify_fogbugz_import_enabled
def
verify_fogbugz_import_enabled
not_found!
unless
fogbugz_import_enabled?
render_404
unless
fogbugz_import_enabled?
end
end
end
end
app/controllers/import/github_controller.rb
View file @
8346dde0
...
@@ -47,7 +47,7 @@ class Import::GithubController < Import::BaseController
...
@@ -47,7 +47,7 @@ class Import::GithubController < Import::BaseController
end
end
def
verify_github_import_enabled
def
verify_github_import_enabled
not_found!
unless
github_import_enabled?
render_404
unless
github_import_enabled?
end
end
def
github_auth
def
github_auth
...
...
app/controllers/import/gitlab_controller.rb
View file @
8346dde0
...
@@ -44,7 +44,7 @@ class Import::GitlabController < Import::BaseController
...
@@ -44,7 +44,7 @@ class Import::GitlabController < Import::BaseController
end
end
def
verify_gitlab_import_enabled
def
verify_gitlab_import_enabled
not_found!
unless
gitlab_import_enabled?
render_404
unless
gitlab_import_enabled?
end
end
def
gitlab_auth
def
gitlab_auth
...
...
app/controllers/import/gitorious_controller.rb
View file @
8346dde0
...
@@ -42,7 +42,7 @@ class Import::GitoriousController < Import::BaseController
...
@@ -42,7 +42,7 @@ class Import::GitoriousController < Import::BaseController
end
end
def
verify_gitorious_import_enabled
def
verify_gitorious_import_enabled
not_found!
unless
gitorious_import_enabled?
render_404
unless
gitorious_import_enabled?
end
end
end
end
app/controllers/import/google_code_controller.rb
View file @
8346dde0
...
@@ -106,7 +106,7 @@ class Import::GoogleCodeController < Import::BaseController
...
@@ -106,7 +106,7 @@ class Import::GoogleCodeController < Import::BaseController
end
end
def
verify_google_code_import_enabled
def
verify_google_code_import_enabled
not_found!
unless
google_code_import_enabled?
render_404
unless
google_code_import_enabled?
end
end
def
user_map
def
user_map
...
...
app/controllers/projects/avatars_controller.rb
View file @
8346dde0
...
@@ -12,7 +12,7 @@ class Projects::AvatarsController < Projects::ApplicationController
...
@@ -12,7 +12,7 @@ class Projects::AvatarsController < Projects::ApplicationController
filename:
@blob
.
name
filename:
@blob
.
name
)
)
else
else
not_found!
render_404
end
end
end
end
...
...
app/controllers/projects/blob_controller.rb
View file @
8346dde0
...
@@ -113,14 +113,14 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -113,14 +113,14 @@ class Projects::BlobController < Projects::ApplicationController
end
end
end
end
return
not_found!
return
render_404
end
end
end
end
def
commit
def
commit
@commit
=
@repository
.
commit
(
@ref
)
@commit
=
@repository
.
commit
(
@ref
)
return
not_found!
unless
@commit
return
render_404
unless
@commit
end
end
def
assign_blob_vars
def
assign_blob_vars
...
@@ -128,7 +128,7 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -128,7 +128,7 @@ class Projects::BlobController < Projects::ApplicationController
@ref
,
@path
=
extract_ref
(
@id
)
@ref
,
@path
=
extract_ref
(
@id
)
rescue
InvalidPathError
rescue
InvalidPathError
not_found!
render_404
end
end
def
after_edit_path
def
after_edit_path
...
...
app/controllers/projects/raw_controller.rb
View file @
8346dde0
...
@@ -20,7 +20,7 @@ class Projects::RawController < Projects::ApplicationController
...
@@ -20,7 +20,7 @@ class Projects::RawController < Projects::ApplicationController
disposition:
'inline'
disposition:
'inline'
)
)
else
else
not_found!
render_404
end
end
end
end
...
...
app/controllers/projects/tree_controller.rb
View file @
8346dde0
...
@@ -10,7 +10,7 @@ class Projects::TreeController < Projects::ApplicationController
...
@@ -10,7 +10,7 @@ class Projects::TreeController < Projects::ApplicationController
before_action
:authorize_push_code!
,
only:
[
:create_dir
]
before_action
:authorize_push_code!
,
only:
[
:create_dir
]
def
show
def
show
return
not_found!
unless
@repository
.
commit
(
@ref
)
return
render_404
unless
@repository
.
commit
(
@ref
)
if
tree
.
entries
.
empty?
if
tree
.
entries
.
empty?
if
@repository
.
blob_at
(
@commit
.
id
,
@path
)
if
@repository
.
blob_at
(
@commit
.
id
,
@path
)
...
@@ -19,7 +19,7 @@ class Projects::TreeController < Projects::ApplicationController
...
@@ -19,7 +19,7 @@ class Projects::TreeController < Projects::ApplicationController
File
.
join
(
@ref
,
@path
))
File
.
join
(
@ref
,
@path
))
)
and
return
)
and
return
elsif
@path
.
present?
elsif
@path
.
present?
return
not_found!
return
render_404
end
end
end
end
...
@@ -31,7 +31,7 @@ class Projects::TreeController < Projects::ApplicationController
...
@@ -31,7 +31,7 @@ class Projects::TreeController < Projects::ApplicationController
end
end
def
create_dir
def
create_dir
return
not_found!
unless
@commit_params
.
values
.
all?
return
render_404
unless
@commit_params
.
values
.
all?
begin
begin
result
=
Files
::
CreateDirService
.
new
(
@project
,
current_user
,
@commit_params
).
execute
result
=
Files
::
CreateDirService
.
new
(
@project
,
current_user
,
@commit_params
).
execute
...
...
app/controllers/projects/uploads_controller.rb
View file @
8346dde0
...
@@ -20,7 +20,7 @@ class Projects::UploadsController < Projects::ApplicationController
...
@@ -20,7 +20,7 @@ class Projects::UploadsController < Projects::ApplicationController
end
end
def
show
def
show
return
not_found!
if
uploader
.
nil?
||
!
uploader
.
file
.
exists?
return
render_404
if
uploader
.
nil?
||
!
uploader
.
file
.
exists?
disposition
=
uploader
.
image?
?
'inline'
:
'attachment'
disposition
=
uploader
.
image?
?
'inline'
:
'attachment'
send_file
uploader
.
file
.
path
,
disposition:
disposition
send_file
uploader
.
file
.
path
,
disposition:
disposition
...
...
app/controllers/uploads_controller.rb
View file @
8346dde0
...
@@ -10,7 +10,7 @@ class UploadsController < ApplicationController
...
@@ -10,7 +10,7 @@ class UploadsController < ApplicationController
end
end
unless
uploader
.
file
&&
uploader
.
file
.
exists?
unless
uploader
.
file
&&
uploader
.
file
.
exists?
return
not_found!
return
render_404
end
end
disposition
=
uploader
.
image?
?
'inline'
:
'attachment'
disposition
=
uploader
.
image?
?
'inline'
:
'attachment'
...
@@ -21,7 +21,7 @@ class UploadsController < ApplicationController
...
@@ -21,7 +21,7 @@ class UploadsController < ApplicationController
def
find_model
def
find_model
unless
upload_model
&&
upload_mount
unless
upload_model
&&
upload_mount
return
not_found!
return
render_404
end
end
@model
=
upload_model
.
find
(
params
[
:id
])
@model
=
upload_model
.
find
(
params
[
:id
])
...
@@ -44,7 +44,7 @@ class UploadsController < ApplicationController
...
@@ -44,7 +44,7 @@ class UploadsController < ApplicationController
return
if
authorized
return
if
authorized
if
current_user
if
current_user
not_found!
render_404
else
else
authenticate_user!
authenticate_user!
end
end
...
...
lib/extracts_path.rb
View file @
8346dde0
...
@@ -110,7 +110,7 @@ module ExtractsPath
...
@@ -110,7 +110,7 @@ module ExtractsPath
@project
,
@ref
,
@path
)
@project
,
@ref
,
@path
)
rescue
RuntimeError
,
NoMethodError
,
InvalidPathError
rescue
RuntimeError
,
NoMethodError
,
InvalidPathError
not_found!
render_404
end
end
def
tree
def
tree
...
...
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