Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2026-07-26 00:58:50 UTC using RuboCop version 1.81.7.
# on 2026-07-26 01:09:44 UTC using RuboCop version 1.88.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -100,7 +100,8 @@ RSpec/NestedGroups:
Max: 6

# Offense count: 1
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
# SupportedInflectors: default, active_support
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/cloudflare/rails_spec.rb'
Expand Down Expand Up @@ -171,7 +172,7 @@ Style/StringLiterals:

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Layout/LineLength:
Max: 126
2 changes: 1 addition & 1 deletion cloudflare-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake', '~> 13.3.0'
spec.add_development_dependency 'rspec', '~> 3.13.0'
spec.add_development_dependency 'rspec-rails', '~> 8.0.2'
spec.add_development_dependency 'rubocop', '~> 1.81.1'
spec.add_development_dependency 'rubocop', '~> 1.88.2'
spec.add_development_dependency 'rubocop-performance', '~> 1.26.0'
spec.add_development_dependency 'rubocop-rails', '~> 2.36.0'
spec.add_development_dependency 'rubocop-rspec', '~> 3.7.0'
Expand Down
11 changes: 6 additions & 5 deletions lib/cloudflare_rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ class Railtie < Rails::Railtie
initializer 'cloudflare_rails.configure_rails_initialization' do
Rack::Request::Helpers.prepend CheckTrustedProxies

ObjectSpace.each_object(Class)
.select do |c|
c.included_modules.include?(Rack::Request::Helpers) &&
c.included_modules.exclude?(CheckTrustedProxies)
end
ObjectSpace
.each_object(Class)
.select do |c|
c.included_modules.include?(Rack::Request::Helpers) &&
c.included_modules.exclude?(CheckTrustedProxies)
end
.map { |c| c.prepend CheckTrustedProxies }

ActionDispatch::RemoteIp.prepend RemoteIpProxies
Expand Down