aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Werkzeug/py2/werkzeug/wrappers/user_agent.py
blob: a32d8acd23b6750913c3b3fa323e2dddd1a44905 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from ..useragents import UserAgent
from ..utils import cached_property


class UserAgentMixin(object):
    """Adds a `user_agent` attribute to the request object which
    contains the parsed user agent of the browser that triggered the
    request as a :class:`~werkzeug.useragents.UserAgent` object.
    """

    @cached_property
    def user_agent(self):
        """The current user agent."""
        return UserAgent(self.environ)