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
980303b5
Commit
980303b5
authored
Sep 01, 2019
by
dineshpanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling freeze on already frozen strings in app/controllers
parent
dc864927
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+3
-3
app/controllers/concerns/lfs_request.rb
app/controllers/concerns/lfs_request.rb
+1
-1
app/controllers/projects/lfs_api_controller.rb
app/controllers/projects/lfs_api_controller.rb
+1
-1
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+3
-3
No files found.
app/controllers/application_controller.rb
View file @
980303b5
...
@@ -47,8 +47,8 @@ class ApplicationController < ActionController::Base
...
@@ -47,8 +47,8 @@ class ApplicationController < ActionController::Base
# Adds `no-store` to the DEFAULT_CACHE_CONTROL, to prevent security
# Adds `no-store` to the DEFAULT_CACHE_CONTROL, to prevent security
# concerns due to caching private data.
# concerns due to caching private data.
DEFAULT_GITLAB_CACHE_CONTROL
=
"
#{
ActionDispatch
::
Http
::
Cache
::
Response
::
DEFAULT_CACHE_CONTROL
}
, no-store"
.
freeze
DEFAULT_GITLAB_CACHE_CONTROL
=
"
#{
ActionDispatch
::
Http
::
Cache
::
Response
::
DEFAULT_CACHE_CONTROL
}
, no-store"
DEFAULT_GITLAB_CONTROL_NO_CACHE
=
"
#{
DEFAULT_GITLAB_CACHE_CONTROL
}
, no-cache"
.
freeze
DEFAULT_GITLAB_CONTROL_NO_CACHE
=
"
#{
DEFAULT_GITLAB_CACHE_CONTROL
}
, no-cache"
rescue_from
Encoding
::
CompatibilityError
do
|
exception
|
rescue_from
Encoding
::
CompatibilityError
do
|
exception
|
log_exception
(
exception
)
log_exception
(
exception
)
...
@@ -143,7 +143,7 @@ class ApplicationController < ActionController::Base
...
@@ -143,7 +143,7 @@ class ApplicationController < ActionController::Base
payload
[
:username
]
=
logged_user
.
try
(
:username
)
payload
[
:username
]
=
logged_user
.
try
(
:username
)
end
end
if
response
.
status
==
422
&&
response
.
body
.
present?
&&
response
.
content_type
==
'application/json'
.
freeze
if
response
.
status
==
422
&&
response
.
body
.
present?
&&
response
.
content_type
==
'application/json'
payload
[
:response
]
=
response
.
body
payload
[
:response
]
=
response
.
body
end
end
...
...
app/controllers/concerns/lfs_request.rb
View file @
980303b5
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
module
LfsRequest
module
LfsRequest
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
CONTENT_TYPE
=
'application/vnd.git-lfs+json'
.
freeze
CONTENT_TYPE
=
'application/vnd.git-lfs+json'
included
do
included
do
before_action
:require_lfs_enabled!
before_action
:require_lfs_enabled!
...
...
app/controllers/projects/lfs_api_controller.rb
View file @
980303b5
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
class
Projects::LfsApiController
<
Projects
::
GitHttpClientController
class
Projects::LfsApiController
<
Projects
::
GitHttpClientController
include
LfsRequest
include
LfsRequest
LFS_TRANSFER_CONTENT_TYPE
=
'application/octet-stream'
.
freeze
LFS_TRANSFER_CONTENT_TYPE
=
'application/octet-stream'
skip_before_action
:lfs_check_access!
,
only:
[
:deprecated
]
skip_before_action
:lfs_check_access!
,
only:
[
:deprecated
]
before_action
:lfs_check_batch_operation!
,
only:
[
:batch
]
before_action
:lfs_check_batch_operation!
,
only:
[
:batch
]
...
...
app/controllers/sessions_controller.rb
View file @
980303b5
...
@@ -40,7 +40,7 @@ class SessionsController < Devise::SessionsController
...
@@ -40,7 +40,7 @@ class SessionsController < Devise::SessionsController
# token mismatch.
# token mismatch.
protect_from_forgery
with: :exception
,
prepend:
true
protect_from_forgery
with: :exception
,
prepend:
true
CAPTCHA_HEADER
=
'X-GitLab-Show-Login-Captcha'
.
freeze
CAPTCHA_HEADER
=
'X-GitLab-Show-Login-Captcha'
MAX_FAILED_LOGIN_ATTEMPTS
=
5
MAX_FAILED_LOGIN_ATTEMPTS
=
5
def
new
def
new
...
@@ -111,14 +111,14 @@ class SessionsController < Devise::SessionsController
...
@@ -111,14 +111,14 @@ class SessionsController < Devise::SessionsController
def
increment_failed_login_captcha_counter
def
increment_failed_login_captcha_counter
Gitlab
::
Metrics
.
counter
(
Gitlab
::
Metrics
.
counter
(
:failed_login_captcha_total
,
:failed_login_captcha_total
,
'Number of failed CAPTCHA attempts for logins'
.
freeze
'Number of failed CAPTCHA attempts for logins'
).
increment
).
increment
end
end
def
increment_successful_login_captcha_counter
def
increment_successful_login_captcha_counter
Gitlab
::
Metrics
.
counter
(
Gitlab
::
Metrics
.
counter
(
:successful_login_captcha_total
,
:successful_login_captcha_total
,
'Number of successful CAPTCHA attempts for logins'
.
freeze
'Number of successful CAPTCHA attempts for logins'
).
increment
).
increment
end
end
...
...
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