Skip to content

support lowercase user agent  #517

Open

Description

@YegorZdanovich

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"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions