-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
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 https://github.com/ua-parser/uap-python 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.