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
6a7711cd
Commit
6a7711cd
authored
May 11, 2018
by
Chantal Rollison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port of ccr/regexp_anchor to EE
parent
db32e49e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
+3
-0
lib/gitlab/incoming_email.rb
lib/gitlab/incoming_email.rb
+1
-1
spec/lib/gitlab/incoming_email_spec.rb
spec/lib/gitlab/incoming_email_spec.rb
+4
-0
No files found.
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
0 → 100644
View file @
6a7711cd
title
:
Add anchor for incoming email regex
merge_request
:
!18917
type
:
added
lib/gitlab/incoming_email.rb
View file @
6a7711cd
...
...
@@ -59,7 +59,7 @@ module Gitlab
regex
=
Regexp
.
escape
(
wildcard_address
)
regex
=
regex
.
sub
(
Regexp
.
escape
(
WILDCARD_PLACEHOLDER
),
'(.+)'
)
Regexp
.
new
(
regex
).
freeze
Regexp
.
new
(
/\A
#{
regex
}
\z/
).
freeze
end
end
end
...
...
spec/lib/gitlab/incoming_email_spec.rb
View file @
6a7711cd
...
...
@@ -84,6 +84,10 @@ describe Gitlab::IncomingEmail do
expect
(
described_class
.
key_from_address
(
"replies+key@example.com"
)).
to
eq
(
"key"
)
end
it
'does not match emails with extra bits'
do
expect
(
described_class
.
key_from_address
(
'somereplies+somekey@example.com.someotherdomain.com'
)).
to
be
nil
end
context
"on GitLab.com"
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
...
...
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