mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
GH-281: Improve parsing of Google Pixel user agent
Fixes GH-281
This commit is contained in:
parent
a342090f18
commit
53dc1176b7
3 changed files with 48 additions and 17 deletions
|
@ -147,6 +147,22 @@ function parse(unparsed_version: string): Description
|
|||
{
|
||||
return parse_mozilla(unparsed_version);
|
||||
}
|
||||
else if ( /A\/[0-9\.]*\/Google\/Pixel/ in unparsed_version )
|
||||
{
|
||||
software_name = "Android (Google Pixel)";
|
||||
local parts = split_string_all(unparsed_version, /\//);
|
||||
if ( 2 in parts )
|
||||
{
|
||||
local vs = parts[2];
|
||||
|
||||
if ( "." in vs )
|
||||
v = parse(vs)$version;
|
||||
else
|
||||
v = Version($major=extract_count(vs));
|
||||
|
||||
return [$version=v, $unparsed_version=unparsed_version, $name=software_name];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# The regular expression should match the complete version number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue