Merge pull request #46910 from skipkayhil/more-string-include
Fix Performance/StringInclude that RuboCop can't
This commit is contained in:
commit
481c169aa5
@ -293,7 +293,7 @@ def match?(mime_type)
|
||||
end
|
||||
|
||||
def html?
|
||||
(symbol == :html) || /html/.match?(@string)
|
||||
(symbol == :html) || @string.include?("html")
|
||||
end
|
||||
|
||||
def all?; false; end
|
||||
|
@ -55,7 +55,7 @@ def call(env)
|
||||
private
|
||||
def html_response?(headers)
|
||||
if content_type = headers[CONTENT_TYPE]
|
||||
/html/.match?(content_type)
|
||||
content_type.include?("html")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user