diff --git a/src/enums/ua-parser-enums.js b/src/enums/ua-parser-enums.js index 9236092..7b4e9a7 100644 --- a/src/enums/ua-parser-enums.js +++ b/src/enums/ua-parser-enums.js @@ -763,8 +763,10 @@ const Extension = Object.freeze({ GOT: 'got', GUZZLEHTTP: 'GuzzleHttp', HACKNEY: 'hackney', + HTTP_RB: 'http.rb', JAVA: 'Java', JAVA_HTTPCLIENT: 'Java-http-client', + JETTY: 'Jetty', JSDOM: 'jsdom', LIBWWW_PERL: 'libwww-perl', LUA_RESTY_HTTP: 'lua-resty-http', @@ -774,6 +776,7 @@ const Extension = Object.freeze({ NODE_JS: 'Node.js', NODE_SUPERAGENT: 'node-superagent', OKHTTP: 'OkHttp', + OCAML_COHTTP: 'ocaml-cohttp', PHP_SOAP: 'PHP-SOAP', POSTMAN_RUNTIME: 'PostmanRuntime', PYTHON_HTTPX: 'python-httpx', diff --git a/src/extensions/ua-parser-extensions.js b/src/extensions/ua-parser-extensions.js index 5b43293..f1d2efb 100644 --- a/src/extensions/ua-parser-extensions.js +++ b/src/extensions/ua-parser-extensions.js @@ -433,8 +433,8 @@ const MediaPlayers = Object.freeze({ const Libraries = Object.freeze({ browser : [ [ - // Apache-HttpClient/Axios/Bun/Dart/go-http-client/got/GuzzleHttp/hackney/Java[-HttpClient]/jsdom/libwww-perl/lua-resty-http/Needle/Node.js/node-fetch/OkHttp/PHP-SOAP/PostmanRuntime/python-urllib/python-requests/rest-client/Scrapy/superagent - /^(apache-httpclient|axios|bun|dart|deno|(?:go|java)-http-client|got|guzzlehttp|hackney|java|libwww-perl|lua-resty-http|needle|node(?:\.js|-fetch|-superagent)|okhttp|php-soap|postmanruntime|python-(?:httpx|urllib[23]?|requests)|rest-client|scrapy)\/([\w\.]+)/i, + // Apache-HttpClient/Axios/Bun/Dart/go-http-client/got/GuzzleHttp/hackney/http.rb/Java[-HttpClient]/Jetty/jsdom/libwww-perl/lua-resty-http/Needle/Node.js/node-fetch/ocaml-cohttp/OkHttp/PHP-SOAP/PostmanRuntime/python-urllib/python-requests/rest-client/Scrapy/superagent + /^((?:apache|go|java)-http-?client|axios|bun|dart|deno|got|(?:guzzle|lua-resty-|ocaml-co|ok)http|hackney|http\.rb|java|jetty|libwww-perl|needle|node(?:\.js|-fetch|-superagent)|php-soap|postmanruntime|python-(?:httpx|urllib[23]?|requests)|rest-client|scrapy)\/([\w\.]+)/i, /(adobeair|aiohttp|jsdom)\/([\w\.]+)/i, /(nutch)-([\w\.-]+)(\(|$)/i, /\((java)\/([\w\.]+)/i diff --git a/test/data/ua/extension/library.json b/test/data/ua/extension/library.json index da29481..8689c26 100644 --- a/test/data/ua/extension/library.json +++ b/test/data/ua/extension/library.json @@ -89,6 +89,16 @@ "type" : "library" } }, + { + "desc" : "GuzzleHttp", + "ua" : "GuzzleHttp/6.5.5 curl/7.70.0 PHP/7.4.22", + "expect" : + { + "name" : "GuzzleHttp", + "version" : "6.5.5", + "type" : "library" + } + }, { "desc" : "hackney", "ua" : "hackney/1.20.1", @@ -100,12 +110,12 @@ } }, { - "desc" : "GuzzleHttp", - "ua" : "GuzzleHttp/6.5.5 curl/7.70.0 PHP/7.4.22", + "desc" : "http.rb", + "ua" : "http.rb/4.2.0", "expect" : { - "name" : "GuzzleHttp", - "version" : "6.5.5", + "name" : "http.rb", + "version" : "4.2.0", "type" : "library" } }, @@ -129,6 +139,16 @@ "type" : "library" } }, + { + "desc" : "Jetty", + "ua" : "Jetty/11.0.13", + "expect" : + { + "name" : "Jetty", + "version" : "11.0.13", + "type" : "library" + } + }, { "desc" : "jsdom", "ua" : "Mozilla/5.0 (unknown OS) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/11.12.0", @@ -199,6 +219,16 @@ "type" : "library" } }, + { + "desc" : "ocaml-cohttp", + "ua" : "ocaml-cohttp/1.2.00", + "expect" : + { + "name" : "ocaml-cohttp", + "version" : "1.2.00", + "type" : "library" + } + }, { "desc" : "OkHttp", "ua" : "okhttp/3.2.0",