lib/rails/auth/x509/middleware.rb in rails-auth-2.1.4 vs lib/rails/auth/x509/middleware.rb in rails-auth-2.2.0
- old
+ new
@@ -38,11 +38,11 @@
end
end
def call(env)
credential = extract_credential(env)
- Rails::Auth.add_credential(env, "x509".freeze, credential.freeze) if credential
+ Rails::Auth.add_credential(env, "x509", credential.freeze) if credential
@app.call(env)
end
private
@@ -60,21 +60,22 @@
raise CertificateVerifyFailed, "verify failed: #{subject(cert)}" if @require_cert
end
end
raise CertificateVerifyFailed, "no client certificate in request" if @require_cert
+
nil
end
def extract_certificate_with_filter(filter, raw_cert)
case raw_cert
when String then return if raw_cert.empty?
when NilClass then return
end
filter.call(raw_cert)
- rescue => ex
- @logger.debug("rails-auth: Certificate error: #{ex.class}: #{ex.message}") if @logger
+ rescue StandardError => e
+ @logger.debug("rails-auth: Certificate error: #{e.class}: #{e.message}") if @logger
nil
end
def log(message, cert)
@logger.debug("rails-auth: #{message} (#{subject(cert)})") if @logger