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
b27e5497
Commit
b27e5497
authored
Apr 04, 2019
by
Patrick Derichs
Committed by
Sean McGivern
Apr 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user agent string for Hosted Jira
parent
13ec1bcb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
ee/changelogs/unreleased/fix-jira-user-agent.yml
ee/changelogs/unreleased/fix-jira-user-agent.yml
+5
-0
ee/lib/gitlab/jira/middleware.rb
ee/lib/gitlab/jira/middleware.rb
+1
-1
ee/spec/lib/gitlab/jira/middleware_spec.rb
ee/spec/lib/gitlab/jira/middleware_spec.rb
+4
-0
No files found.
ee/changelogs/unreleased/fix-jira-user-agent.yml
0 → 100644
View file @
b27e5497
---
title
:
Fix user agent string for Hosted Jira
merge_request
:
10545
author
:
type
:
fixed
ee/lib/gitlab/jira/middleware.rb
View file @
b27e5497
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Jira
class
Middleware
def
self
.
jira_dvcs_connector?
(
env
)
env
[
'HTTP_USER_AGENT'
]
&
.
start_with?
(
'JIRA DVCS C
onnector'
)
env
[
'HTTP_USER_AGENT'
]
&
.
downcase
&
.
start_with?
(
'jira dvcs c
onnector'
)
end
def
initialize
(
app
)
...
...
ee/spec/lib/gitlab/jira/middleware_spec.rb
View file @
b27e5497
...
...
@@ -10,6 +10,10 @@ describe Gitlab::Jira::Middleware do
expect
(
described_class
.
jira_dvcs_connector?
(
'HTTP_USER_AGENT'
=>
jira_user_agent
)).
to
eq
(
true
)
end
it
'returns true if user agent starts with "Jira DVCS Connector"'
do
expect
(
described_class
.
jira_dvcs_connector?
(
'HTTP_USER_AGENT'
=>
'Jira DVCS Connector'
)).
to
eq
(
true
)
end
it
'returns false when not DVCS connector'
do
expect
(
described_class
.
jira_dvcs_connector?
(
'HTTP_USER_AGENT'
=>
'pokemon'
)).
to
eq
(
false
)
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