Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support lowercase user agent #517

Open
YegorZdanovich opened this issue Mar 17, 2021 · 0 comments
Open

support lowercase user agent #517

YegorZdanovich opened this issue Mar 17, 2021 · 0 comments

Comments

@YegorZdanovich
Copy link

YegorZdanovich commented Mar 17, 2021

Hi,
I have table with unique user agents. I store them as lowercased values. I wanted to do some analyses based on my data, but figure out that gem doesn't detected browser correct.

Browser.new("mozilla/5.0 (windows nt 10.0; win64; x64; rv:52.0) gecko/20100101 firefox/52.0").name
 => "Generic Browser"

then i checked logic detection and found that in most matchers strings are compared case sensitive https://github.com/fnando/browser/blob/main/lib/browser/firefox.rb#L18

So, when i changed one symbol it works as expected.

Browser.new("mozilla/5.0 (windows nt 10.0; win64; x64; rv:52.0) gecko/20100101 Firefox/52.0").name
 => "Firefox"

So, is it possible to add lowercase string support? Basically, if you compare strings above - it's same browser, but we have different results.

Software:

  • Rails Version: "6.0.3.2"

  • Browser gem version: "2.5.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant