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
e92dbcf7
Commit
e92dbcf7
authored
Nov 01, 2020
by
Greg Myers
Committed by
Thong Kuah
Nov 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add User-Agent to web hook service
parent
e70f863d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
app/services/web_hook_service.rb
app/services/web_hook_service.rb
+1
-0
changelogs/unreleased/gregmyers-webhook-useragent.yml
changelogs/unreleased/gregmyers-webhook-useragent.yml
+5
-0
spec/services/web_hook_service_spec.rb
spec/services/web_hook_service_spec.rb
+1
-0
No files found.
app/services/web_hook_service.rb
View file @
e92dbcf7
...
...
@@ -120,6 +120,7 @@ class WebHookService
@headers
||=
begin
{
'Content-Type'
=>
'application/json'
,
'User-Agent'
=>
"GitLab/
#{
Gitlab
::
VERSION
}
"
,
GITLAB_EVENT_HEADER
=>
self
.
class
.
hook_to_event
(
hook_name
)
}.
tap
do
|
hash
|
hash
[
'X-Gitlab-Token'
]
=
Gitlab
::
Utils
.
remove_line_breaks
(
hook
.
token
)
if
hook
.
token
.
present?
...
...
changelogs/unreleased/gregmyers-webhook-useragent.yml
0 → 100644
View file @
e92dbcf7
---
title
:
Add User-Agent to web hook service
merge_request
:
46070
author
:
type
:
added
spec/services/web_hook_service_spec.rb
View file @
e92dbcf7
...
...
@@ -10,6 +10,7 @@ RSpec.describe WebHookService do
let
(
:headers
)
do
{
'Content-Type'
=>
'application/json'
,
'User-Agent'
=>
"GitLab/
#{
Gitlab
::
VERSION
}
"
,
'X-Gitlab-Event'
=>
'Push Hook'
}
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