Skip to content

fix: Parse Crosswalk UA as Android not ChromeOS (#1024)#1572

Merged
davidism merged 2 commits intopallets:masterfrom
lewisheadden:1024-fix-crosswalk-ua-as-cros
Jun 1, 2019
Merged

fix: Parse Crosswalk UA as Android not ChromeOS (#1024)#1572
davidism merged 2 commits intopallets:masterfrom
lewisheadden:1024-fix-crosswalk-ua-as-cros

Conversation

@lewisheadden
Copy link
Copy Markdown
Contributor

In #1024, it was shown that when using the Crosswalk Webview, the user agent parsing in Werkzeug would categorize Crosswalk as ChromeOS rather than Android although it was running on Android.

This occurred as we rely on matching cros anywhere in the UA string to determine if a UA is from ChromeOS. Upon reviewing ChromeOS UA strings, it became clear that CrOS is always surrounded by a space on either side. As such, this change makes us check for cros instead of cros and adds test coverage for this case.

It should be noted that on #1024, @alexpantyukhin proposes ensuring we check all strings as separate words (e.g. expecting a space on either side or the beginning or end of line). This may be reasonable but I'm unclear of how it might affect parsing other UA strings that aren't covered in the test cases.

@davidism davidism added this to the 1.0.0 milestone May 31, 2019
@davidism davidism merged commit f60bc58 into pallets:master Jun 1, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants