Skip to content

Commit

Permalink
fix(device): ensure chromecast parsing doesn't return null
Browse files Browse the repository at this point in the history
This is supported by the JS library, but not by all the others. This sets the
model to Chromecast, to prevent any possible error going on, as the model is
needed in that regex.
  • Loading branch information
lbarthon committed Jun 3, 2024
1 parent ae4c16d commit 3421cb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2513,7 +2513,7 @@ device_parsers:
- regex: 'CrKey/'
brand_replacement: 'Google'
device_replacement: 'Chromecast'
model_replacement: null
model_replacement: 'Chromecast'

#########
# Cloudfone
Expand Down
2 changes: 1 addition & 1 deletion tests/test_device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7763,7 +7763,7 @@ test_cases:
- user_agent_string: 'Mozilla/5.0 (X11; Linux armv7l) CrKey/1'
family: 'Chromecast'
brand: 'Google'
model: null
model: 'Chromecast'

- user_agent_string: 'Mozilla/5.0 (Linux; U; Android 2.3.5; En-gb; Cloudfone_Excite320e Build/GRJ90) AppleWebKit/533.1 (KHTML, Like Gecko) Version/4.0 Mobile Safari/533.1'
family: 'Cloudfone Excite 320e'
Expand Down

0 comments on commit 3421cb1

Please sign in to comment.