File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ from importlib .metadata import version
2+
3+ __version__ = version ("plain.scan" )
4+
5+ __all__ = ["__version__" ]
Original file line number Diff line number Diff line change 66from requests .exceptions import ConnectionError as RequestsConnectionError
77from requests .exceptions import SSLError
88
9+ from . import __version__
910from .audits import (
1011 ContentTypeOptionsAudit ,
1112 CookiesAudit ,
@@ -52,10 +53,14 @@ def fetch(self) -> requests.Response:
5253 """Fetch the URL and cache the response."""
5354 if self .response is None :
5455 try :
56+ user_agent = (
57+ f"plain-scan/{ __version__ } (+https://plainframework.com/scan)"
58+ )
5559 self .response = requests .get (
5660 self .url ,
5761 allow_redirects = True ,
5862 timeout = 30 ,
63+ headers = {"User-Agent" : user_agent },
5964 )
6065 except (
6166 SSLError ,
You can’t perform that action at this time.
0 commit comments