Skip to content

Commit

Permalink
Backport - Fix #747: Python Request mistakenly identified as Meta Quest
Browse files Browse the repository at this point in the history
(cherry picked from commit 391b808)
  • Loading branch information
faisalman committed Dec 21, 2024
1 parent 1665684 commit 88fa66d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,16 @@
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
/droid.+; (wt63?0{2,3})\)/i
], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [
/(quest( \d| pro)?)/i // Oculus Quest

///////////////////
// XR
///////////////////

/droid.+; (glass) \d/i // Google Glass
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
/(pico) (4|neo3(?: link|pro)?)/i // Pico
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
/; (quest( \d| pro)?)/i // Oculus Quest
], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [

///////////////////
Expand Down
15 changes: 12 additions & 3 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,15 @@
"type": "wearable"
}
},
{
"desc": "Issue #747",
"ua": "python-requests/2.25.1",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "undefined"
}
},
{
"desc": "OnePlus One",
"ua": "Mozilla/5.0 (Linux; Android 4.4.4; A0001 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.59 Mobile Safari/537.36",
Expand Down Expand Up @@ -2012,7 +2021,7 @@
"expect": {
"vendor": "PICO",
"model": "4",
"type": "xr"
"type": "wearable"
}
},
{
Expand All @@ -2021,7 +2030,7 @@
"expect": {
"vendor": "PICO",
"model": "4",
"type": "xr"
"type": "wearable"
}
},
{
Expand All @@ -2030,7 +2039,7 @@
"expect": {
"vendor": "Pico",
"model": "Neo3 Link",
"type": "xr"
"type": "wearable"
}
},
{
Expand Down

0 comments on commit 88fa66d

Please sign in to comment.