summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSemyon Pupkov <mail@semyonpupkov.com>2018-09-21 11:55:02 +0500
committerSemyon Pupkov <mail@semyonpupkov.com>2018-09-21 12:37:57 +0500
commit869d8e814e4fcc4809dada1e2b34d4993461bda5 (patch)
tree415b27cfe2dff7b6ffe7fc5c82d22acd0defc0b2
parent2d0839e54295bd14cfbd2e7d18f46522324670b9 (diff)
downloadgitlab-ce-869d8e814e4fcc4809dada1e2b34d4993461bda5.tar.gz
Fix UriDefaultParser cop
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--lib/gitlab/url_sanitizer.rb2
2 files changed, 1 insertions, 6 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index e18fbd1fc07..a654c5bb631 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -130,11 +130,6 @@ Naming/HeredocDelimiterCase:
Naming/HeredocDelimiterNaming:
Enabled: false
-# Offense count: 1
-# Cop supports --auto-correct.
-Performance/UriDefaultParser:
- Exclude:
- - 'lib/gitlab/url_sanitizer.rb'
# Offense count: 3821
# Configuration parameters: Prefixes.
diff --git a/lib/gitlab/url_sanitizer.rb b/lib/gitlab/url_sanitizer.rb
index 308a95d2f09..29672d68cad 100644
--- a/lib/gitlab/url_sanitizer.rb
+++ b/lib/gitlab/url_sanitizer.rb
@@ -3,7 +3,7 @@ module Gitlab
ALLOWED_SCHEMES = %w[http https ssh git].freeze
def self.sanitize(content)
- regexp = URI::Parser.new.make_regexp(ALLOWED_SCHEMES)
+ regexp = URI::DEFAULT_PARSER.make_regexp(ALLOWED_SCHEMES)
content.gsub(regexp) { |url| new(url).masked_url }
rescue Addressable::URI::InvalidURIError