diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2018-09-21 11:55:02 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2018-09-21 12:37:57 +0500 |
commit | 869d8e814e4fcc4809dada1e2b34d4993461bda5 (patch) | |
tree | 415b27cfe2dff7b6ffe7fc5c82d22acd0defc0b2 | |
parent | 2d0839e54295bd14cfbd2e7d18f46522324670b9 (diff) | |
download | gitlab-ce-869d8e814e4fcc4809dada1e2b34d4993461bda5.tar.gz |
Fix UriDefaultParser cop
-rw-r--r-- | .rubocop_todo.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/url_sanitizer.rb | 2 |
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 |