diff --git a/docs/usage.rst b/docs/usage.rst index eaf0180..1cc2049 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -176,6 +176,14 @@ tries This only works when the source implementation uses the builtin HTTP client. +httptoken + A personal authorization token used to call the url. The type of token depends on the authorization required. + + - For Bearer token set : ``Bearer `` + - For Basic token set : ``Basic `` + + In the keyfile add ``httptoken_{name}`` token. + If both ``prefix`` and ``from_pattern``/``to_pattern`` are used, ``from_pattern``/``to_pattern`` are ignored. If you want to strip the prefix and then do something special, just use ``from_pattern```/``to_pattern``. For @@ -233,17 +241,6 @@ regex When multiple version strings are found, the maximum of those is chosen. -token - (*Optional*) A personal authorization token used to call the url. The type of token depends on the authorization required. - - - For Bearer token set : ``Bearer `` - - For Basic token set : ``Basic `` - -To set an authorization token, you can set: - -- a key named ``regex_`` in the keyfile -- the token option - This source supports :ref:`list options`. Search in an HTTP header @@ -273,17 +270,6 @@ method follow_redirects (*Optional*) Whether to follow 3xx HTTP redirects. Default is ``false``. If you are looking at a ``Location`` header, you shouldn't change this. -token - (*Optional*) A personal authorization token used to call the url. The type of token depends on the authorization required. - - - For Bearer token set : ``Bearer `` - - For Basic token set : ``Basic <>`` - -To set an authorization token, you can set: - -- a key named ``httpheader_`` in the keyfile -- the token option - Search with an HTML Parser ~~~~~~~~~~~~~~~~~~~~~~~~~~ :: @@ -298,17 +284,6 @@ url xpath A xpath expression used to find the version string -token - (*Optional*) A personal authorization token used to call the url. The type of token depends on the authorization required. - - - For Bearer token set : ``Bearer `` - - For Basic token set : ``Basic <>`` - -To set an authorization token, you can set: - -- a key named ``htmlparser_`` in the keyfile -- the token option - Find with a Command ~~~~~~~~~~~~~~~~~~~ :: diff --git a/nvchecker/util.py b/nvchecker/util.py index 9db7e82..25c14f1 100644 --- a/nvchecker/util.py +++ b/nvchecker/util.py @@ -225,7 +225,7 @@ class FunctionWorker(BaseWorker): ua = entry.get('user_agent', None) if ua is not None: ctx_ua.set(ua) - httpt = entry.get('httptoken_'+name, None) + httpt = entry.get('httptoken', None) if httpt is not None: ctx_httpt.set(httpt) else: