lib/rails/auth/x509/middleware.rb in rails-auth-0.5.3 vs lib/rails/auth/x509/middleware.rb in rails-auth-1.0.0
- old
+ new
@@ -28,11 +28,14 @@
@cert_filters = cert_filters
@cert_filters.each do |key, filter|
next unless filter.is_a?(Symbol)
+ # Convert snake_case to CamelCase
+ filter_name = filter.to_s.split("_").map(&:capitalize).join
+
# Shortcut syntax for symbols
- @cert_filters[key] = Rails::Auth::X509::Filter.const_get(filter.to_s.capitalize).new
+ @cert_filters[key] = Rails::Auth::X509::Filter.const_get(filter_name).new
end
end
def call(env)
credential = extract_credential(env)