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
126db264
Commit
126db264
authored
Dec 07, 2021
by
Ethan Urie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make regex a constant
parent
4603a283
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lib/gitlab/spamcheck/client.rb
lib/gitlab/spamcheck/client.rb
+3
-1
No files found.
lib/gitlab/spamcheck/client.rb
View file @
126db264
...
@@ -21,6 +21,8 @@ module Gitlab
...
@@ -21,6 +21,8 @@ module Gitlab
update:
::
Spamcheck
::
Action
::
UPDATE
update:
::
Spamcheck
::
Action
::
UPDATE
}.
freeze
}.
freeze
URL_SCHEME_REGEX
=
%r{^grpc://|^tls://}
def
initialize
def
initialize
@endpoint_url
=
Gitlab
::
CurrentSettings
.
current_application_settings
.
spam_check_endpoint_url
@endpoint_url
=
Gitlab
::
CurrentSettings
.
current_application_settings
.
spam_check_endpoint_url
...
@@ -28,7 +30,7 @@ module Gitlab
...
@@ -28,7 +30,7 @@ module Gitlab
# remove the `grpc://` or 'tls://' as it's only useful to ensure we're expecting to
# remove the `grpc://` or 'tls://' as it's only useful to ensure we're expecting to
# connect with Spamcheck
# connect with Spamcheck
@endpoint_url
=
@endpoint_url
.
sub
(
%r{^grpc://|^tls://}
,
''
)
@endpoint_url
=
@endpoint_url
.
sub
(
URL_SCHEME_REGEX
,
''
)
end
end
def
issue_spam?
(
spam_issue
:,
user
:,
context:
{})
def
issue_spam?
(
spam_issue
:,
user
:,
context:
{})
...
...
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