aboutsummaryrefslogtreecommitdiffstats
path: root/python/werkzeug/wrappers/user_agent.py
blob: 72588dd94f1271a0326dc47d39b6dec878811685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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."""
        from ..useragents import UserAgent

        return UserAgent(self.environ)