Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserAgent error #8

Open
ZARk-be opened this issue Aug 12, 2020 · 6 comments
Open

UserAgent error #8

ZARk-be opened this issue Aug 12, 2020 · 6 comments

Comments

@ZARk-be
Copy link

ZARk-be commented Aug 12, 2020

Hello

I've just switched to a Motorola One Macro.
And for some reason, the useragent string isn't parsed properly by the boot.rebble.io website.
(I simulated this on PC using my useragent string with the User-Agent Switcher extension).

Basically, because "macro" contains the word "mac" ... it's not detected properly as a mobile platform. I guess it's a bug in flask ?

my useragent string for testing purposes :
Mozilla/5.0 (Linux; Android 9; motorola one macro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36

@Willow-Systems
Copy link
Member

Thanks @ZARk-be , I'll look into this

@ZARk-be
Copy link
Author

ZARk-be commented Aug 17, 2020

Thanks @ZARk-be , I'll look into this

ok great. Normally i'd fix this and drop a PR, but i'm not fluent with python :)

@mhelmetag
Copy link

mhelmetag commented Sep 2, 2020

>>> from werkzeug.useragents import UserAgent
>>> UserAgent("Mozilla/5.0 (Linux; Android 9; motorola one macro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36").platform
'macos'

It sure is getting confused. No idea what to do about that though...

@mhelmetag
Copy link

I can open a ticket with werkzeug?

@mhelmetag
Copy link

pallets/werkzeug#1923

@mhelmetag
Copy link

For this... since user agent parsing is hard (I guess)... what about something like "We think you're running this platform and recommend this installer" and the user can choose the one they want anyways (maybe after a confirm check if it's not recommended)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants