You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
444B

  1. from ..utils import cached_property
  2. class UserAgentMixin(object):
  3. """Adds a `user_agent` attribute to the request object which
  4. contains the parsed user agent of the browser that triggered the
  5. request as a :class:`~werkzeug.useragents.UserAgent` object.
  6. """
  7. @cached_property
  8. def user_agent(self):
  9. """The current user agent."""
  10. from ..useragents import UserAgent
  11. return UserAgent(self.environ)