Fix UriDefaultParser cop
This commit is contained in:
parent
2d0839e542
commit
869d8e814e
2 changed files with 1 additions and 6 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue