Update application_controller.rb

This commit is contained in:
TianLun Song 2025-01-27 09:20:14 +08:00 committed by GitHub
parent 9e666310cf
commit 59a3f792c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,20 @@ class ApplicationController < ActionController::Base
/ToutiaoMicroApp/,
/BytedanceWebview/,
/ArkWeb/
]
],
on_failure: -> (browser) {
Rails.logger.warn <<~BROWSER_INFO
Browser Blocked:
User Agent: #{browser.ua}
Name: #{browser.name}
Version: #{browser.version}
Platform: #{browser.platform.name}
Device: #{browser.device.name}
Mobile: #{browser.mobile?}
Modern: #{browser.modern?}
Bot: #{browser.bot?}
BROWSER_INFO
}
before_action :set_locale
before_action :log_browser_info
after_action :track_action