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

deprecate most user agent functionality #2078

davidism opened this issue Apr 4, 2021 · 0 comments · Fixed by #2081

deprecate most user agent functionality #2078

davidism opened this issue Apr 4, 2021 · 0 comments · Fixed by #2081


Copy link

davidism commented Apr 4, 2021

The user agent parser keeps getting more complicated, but is not nearly complicated enough to actually be a comprehensive implementation. There are better libraries such as that will receive dedicated attention and updates. We don't want to continue tweaking the logic and regex patterns over and over again. User agent detection in general isn't usually a good idea, and there are dedicated tools for collecting metrics, which seems to be the one legitimate use case.

Keep our UserAgent object API, but make most of the properties raise an error (deprecation warning at first). Add Request.user_agent_class to allow extension packages to provide a sublcass that implements the full API with a given library. Ours will eventually only provide request.user_agent.string, the other properties would need to be provided by an extension.

@davidism davidism added this to the 2.0.0 milestone Apr 8, 2021
@davidism davidism self-assigned this Apr 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging a pull request may close this issue.

1 participant