diff --git a/aiohttp/helpers.py b/aiohttp/helpers.py index 861820599c3..5a74259eb3a 100644 --- a/aiohttp/helpers.py +++ b/aiohttp/helpers.py @@ -46,19 +46,7 @@ def __new__(cls, login, password='', encoding='latin1'): @classmethod def decode(cls, auth_header, encoding='latin1'): """Create a :class:`BasicAuth` object from an ``Authorization`` HTTP - header. - - :param auth_header: The value of the ``Authorization`` header. - :type auth_header: str - :param encoding: The character encoding used on the password. - :type encoding: str - - :returns: The decoded authentication. - :rtype: :class:`BasicAuth` - - :raises ValueError: if the headers are unable to be decoded. - - """ + header.""" split = auth_header.strip().split(' ') if len(split) == 2: if split[0].strip().lower() != 'basic': diff --git a/docs/client_reference.rst b/docs/client_reference.rst index 69cea594ccf..c446a76d56d 100644 --- a/docs/client_reference.rst +++ b/docs/client_reference.rst @@ -1290,10 +1290,13 @@ BasicAuth e.g. *auth* parameter for :meth:`ClientSession.request`. - .. classmethod:: decode() + .. classmethod:: decode(auth_header, encoding='latin1') Decode HTTP basic authentication credentials. + :param str auth_header: The ``Authorization`` header to decode. + :param str encoding: (optional) encoding ('latin1' by default) + :return: decoded authentication data, :class:`BasicAuth`.