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
0f832a56
Commit
0f832a56
authored
Sep 30, 2019
by
Vitali Tatarintev
Committed by
Peter Leitzen
Sep 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip CSRF protection in Generic Alerts Endpoint
Public API endpoints doesn't need to have CSRF protection
parent
72e1c25a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
ee/app/controllers/projects/alerting/notifications_controller.rb
...controllers/projects/alerting/notifications_controller.rb
+1
-0
ee/spec/controllers/projects/alerting/notifications_controller_spec.rb
...ollers/projects/alerting/notifications_controller_spec.rb
+4
-0
No files found.
ee/app/controllers/projects/alerting/notifications_controller.rb
View file @
0f832a56
...
...
@@ -5,6 +5,7 @@ module Projects
class
NotificationsController
<
Projects
::
ApplicationController
respond_to
:json
skip_before_action
:verify_authenticity_token
skip_before_action
:project
prepend_before_action
:repository
,
:project_without_auth
...
...
ee/spec/controllers/projects/alerting/notifications_controller_spec.rb
View file @
0f832a56
...
...
@@ -10,6 +10,10 @@ describe Projects::Alerting::NotificationsController do
let
(
:service_response
)
{
ServiceResponse
.
success
}
let
(
:notify_service
)
{
instance_double
(
Projects
::
Alerting
::
NotifyService
,
execute:
service_response
)
}
around
do
|
example
|
ForgeryProtection
.
with_forgery_protection
{
example
.
run
}
end
before
do
allow
(
Projects
::
Alerting
::
NotifyService
).
to
receive
(
:new
).
and_return
(
notify_service
)
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