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

user_agent does not return browser/platform info #122

Closed
szorowi1 opened this issue Apr 9, 2023 · 0 comments · Fixed by #123 or #124
Closed

user_agent does not return browser/platform info #122

szorowi1 opened this issue Apr 9, 2023 · 0 comments · Fixed by #123 or #124
Assignees
Labels
bug Something isn't working

Comments

@szorowi1
Copy link
Contributor

szorowi1 commented Apr 9, 2023

As of Werkzeug 2.0 / Flask 2.1, the parsed data of request.user_agent has been deprecated (see here for discussion). As such, calls such as request.user_agent.browser and request.user_agent.platform will no longer work and will return None. This issue was recently pointed out by @YJ-Ren.

The suggested solution is to simply return the entire user agent string (i.e., request.user_agent.string) and have NivTurk users parse that information, when necessary, using external resources such as browser-info or ua-parser.

@szorowi1 szorowi1 added the bug Something isn't working label Apr 9, 2023
@szorowi1 szorowi1 self-assigned this Apr 9, 2023
@szorowi1 szorowi1 linked a pull request Apr 9, 2023 that will close this issue
szorowi1 added a commit that referenced this issue Apr 10, 2023
* - remove deprecated `request.user_agent` calls 
- return entire `user_agent` string
- update list of screened devices

* update CHANGELOG
szorowi1 added a commit that referenced this issue Apr 10, 2023
* - remove deprecated `request.user_agent` calls
- return entire `user_agent` string
- update list of screened devices

* update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant