Closed rocket-turtle closed 3 years ago
In Rails, I'd definitely go with rescue_from(Browser::Error, &block)
on ApplicationController
, returning a 400 status.
Are you getting errors from legit users?
Im just updating to the new version and was curios because there was nothing in the docs.
Thank you for your suggestion. I'm going to rescue the Exception.
Hi, there was a new Exception introduced with this Issue: https://github.com/fnando/browser/pull/493
So I would be interessted in how you handle this Exception.
I included this into the Controller: https://github.com/fnando/browser/blob/main/lib/browser/action_controller.rb
Possibility 1: ignore the Exception
browser.ie?
Cons: Might get an exception in the prod System.Possibility 2: rescue the Exception
browser.ie? rescue false
Cons: Musst be placed everywhere.Possibility 3: increase
user_agent_size_limit
to Server Limit https://github.com/fnando/browser/pull/500#issuecomment-703029580 Cons: Need to know the Server Limit, might be big.Possibility 4: Monkey patch
Browser.new
Monkey patchBrowser.new
to allways reduce ua touser_agent_size_limit
Cons: Monkey patchPossibility 5: ??? Other ideas
Thank you for your time.