Skip to content

Commit 66f3858

Browse files
committed
[extensions] Add new library: http.rb, Jetty, ocaml-cohttp
1 parent 0273bf6 commit 66f3858

3 files changed

Lines changed: 39 additions & 6 deletions

File tree

src/enums/ua-parser-enums.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,10 @@ const Extension = Object.freeze({
763763
GOT: 'got',
764764
GUZZLEHTTP: 'GuzzleHttp',
765765
HACKNEY: 'hackney',
766+
HTTP_RB: 'http.rb',
766767
JAVA: 'Java',
767768
JAVA_HTTPCLIENT: 'Java-http-client',
769+
JETTY: 'Jetty',
768770
JSDOM: 'jsdom',
769771
LIBWWW_PERL: 'libwww-perl',
770772
LUA_RESTY_HTTP: 'lua-resty-http',
@@ -774,6 +776,7 @@ const Extension = Object.freeze({
774776
NODE_JS: 'Node.js',
775777
NODE_SUPERAGENT: 'node-superagent',
776778
OKHTTP: 'OkHttp',
779+
OCAML_COHTTP: 'ocaml-cohttp',
777780
PHP_SOAP: 'PHP-SOAP',
778781
POSTMAN_RUNTIME: 'PostmanRuntime',
779782
PYTHON_HTTPX: 'python-httpx',

src/extensions/ua-parser-extensions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ const MediaPlayers = Object.freeze({
433433
const Libraries = Object.freeze({
434434
browser : [
435435
[
436-
// 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
437-
/^(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,
436+
// 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
437+
/^((?: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,
438438
/(adobeair|aiohttp|jsdom)\/([\w\.]+)/i,
439439
/(nutch)-([\w\.-]+)(\(|$)/i,
440440
/\((java)\/([\w\.]+)/i

test/data/ua/extension/library.json

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@
8989
"type" : "library"
9090
}
9191
},
92+
{
93+
"desc" : "GuzzleHttp",
94+
"ua" : "GuzzleHttp/6.5.5 curl/7.70.0 PHP/7.4.22",
95+
"expect" :
96+
{
97+
"name" : "GuzzleHttp",
98+
"version" : "6.5.5",
99+
"type" : "library"
100+
}
101+
},
92102
{
93103
"desc" : "hackney",
94104
"ua" : "hackney/1.20.1",
@@ -100,12 +110,12 @@
100110
}
101111
},
102112
{
103-
"desc" : "GuzzleHttp",
104-
"ua" : "GuzzleHttp/6.5.5 curl/7.70.0 PHP/7.4.22",
113+
"desc" : "http.rb",
114+
"ua" : "http.rb/4.2.0",
105115
"expect" :
106116
{
107-
"name" : "GuzzleHttp",
108-
"version" : "6.5.5",
117+
"name" : "http.rb",
118+
"version" : "4.2.0",
109119
"type" : "library"
110120
}
111121
},
@@ -129,6 +139,16 @@
129139
"type" : "library"
130140
}
131141
},
142+
{
143+
"desc" : "Jetty",
144+
"ua" : "Jetty/11.0.13",
145+
"expect" :
146+
{
147+
"name" : "Jetty",
148+
"version" : "11.0.13",
149+
"type" : "library"
150+
}
151+
},
132152
{
133153
"desc" : "jsdom",
134154
"ua" : "Mozilla/5.0 (unknown OS) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/11.12.0",
@@ -199,6 +219,16 @@
199219
"type" : "library"
200220
}
201221
},
222+
{
223+
"desc" : "ocaml-cohttp",
224+
"ua" : "ocaml-cohttp/1.2.00",
225+
"expect" :
226+
{
227+
"name" : "ocaml-cohttp",
228+
"version" : "1.2.00",
229+
"type" : "library"
230+
}
231+
},
202232
{
203233
"desc" : "OkHttp",
204234
"ua" : "okhttp/3.2.0",

0 commit comments

Comments
 (0)