You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
435 B
Python
15 lines
435 B
Python
5 years ago
|
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)
|