Merge pull request #46910 from skipkayhil/more-string-include

Fix Performance/StringInclude that RuboCop can't
This commit is contained in:
Jean Boussier 2023-01-07 14:32:49 +01:00 committed by GitHub
commit 481c169aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

@ -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