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
29521a31
Commit
29521a31
authored
Nov 10, 2017
by
Francisco Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the rss url guard clause
parent
f1896575
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
lib/gitlab/auth/user_auth_finders.rb
lib/gitlab/auth/user_auth_finders.rb
+1
-1
spec/requests/rack_attack_global_spec.rb
spec/requests/rack_attack_global_spec.rb
+3
-5
No files found.
lib/gitlab/auth/user_auth_finders.rb
View file @
29521a31
...
@@ -10,7 +10,7 @@ module Gitlab
...
@@ -10,7 +10,7 @@ module Gitlab
end
end
def
find_user_from_rss_token
def
find_user_from_rss_token
return
unless
current_request
.
format
.
atom?
return
unless
current_request
.
path
.
ends_with?
(
'.atom'
)
token
=
current_request
.
params
[
:rss_token
].
presence
token
=
current_request
.
params
[
:rss_token
].
presence
return
unless
token
return
unless
token
...
...
spec/requests/rack_attack_global_spec.rb
View file @
29521a31
...
@@ -241,14 +241,12 @@ describe 'Rack Attack global throttles' do
...
@@ -241,14 +241,12 @@ describe 'Rack Attack global throttles' do
let
(
:throttle_setting_prefix
)
{
'throttle_authenticated_web'
}
let
(
:throttle_setting_prefix
)
{
'throttle_authenticated_web'
}
context
'with the token in the query string'
do
context
'with the token in the query string'
do
context
'with the atom format in the Accept header'
do
let
(
:get_args
)
{
[
rss_url
(
user
),
nil
]
}
let
(
:get_args
)
{
[
rss_url
(
user
),
nil
,
{
'HTTP_ACCEPT'
=>
'application/atom+xml'
}]
}
let
(
:other_user_get_args
)
{
[
rss_url
(
other_user
),
nil
]
}
let
(
:other_user_get_args
)
{
[
rss_url
(
other_user
),
nil
,
{
'HTTP_ACCEPT'
=>
'application/atom+xml'
}]
}
it_behaves_like
'rate-limited token-authenticated requests'
it_behaves_like
'rate-limited token-authenticated requests'
end
end
end
end
end
describe
'web requests authenticated with regular login'
do
describe
'web requests authenticated with regular login'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
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