Skip to content

Commit

Permalink
Merge pull request #46910 from skipkayhil/more-string-include
Browse files Browse the repository at this point in the history
Fix Performance/StringInclude that RuboCop can't
  • Loading branch information
byroot committed Jan 7, 2023
2 parents 131307e + 583ce94 commit 481c169
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/http/mime_type.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/http/permissions_policy.rb
Expand Up @@ -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

Expand Down

0 comments on commit 481c169

Please sign in to comment.