Update value of User-Agent HTTP request header used by listers
That HTTP header value will now contain the lister name but also a link to our contact form in order for sysadmins to easily reach us if needed. The following template is used to generate it: "Software Heritage <lister_name> lister v<swh-lister version> (+https://www.softwareheritage.org/contact)"
This commit is contained in:
parent
db6ce12e9e
commit
d5c30a3ce3
11 changed files with 38 additions and 36 deletions
|
@ -18,7 +18,6 @@ from swh.core.github.utils import GitHubSession
|
|||
from swh.scheduler.interface import SchedulerInterface
|
||||
from swh.scheduler.model import ListedOrigin
|
||||
|
||||
from .. import USER_AGENT
|
||||
from ..pattern import CredentialsType, Lister
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -95,7 +94,8 @@ class MavenLister(Lister[MavenListerState, RepoPage]):
|
|||
|
||||
self.jar_origins: Dict[str, ListedOrigin] = {}
|
||||
self.github_session = GitHubSession(
|
||||
credentials=self.credentials, user_agent=USER_AGENT
|
||||
credentials=self.credentials,
|
||||
user_agent=str(self.session.headers["User-Agent"]),
|
||||
)
|
||||
|
||||
def state_from_dict(self, d: Dict[str, Any]) -> MavenListerState:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue