Skip to content

Commit

Permalink
Add constant for user agent string
Browse files Browse the repository at this point in the history
  • Loading branch information
bltravis committed Oct 13, 2024
1 parent ffca6b8 commit 1b485ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions folioclient/FolioClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

RAML_UTIL_URL = "https://raw.githubusercontent.com/folio-org/raml/raml1.0"

USER_AGENT_STRING = "Folio Client (https://github.com/FOLIO-FSE/FolioClient)"

class FolioClient:
"""handles communication and getting values from FOLIO"""
Expand Down Expand Up @@ -444,7 +445,7 @@ def get_latest_from_github(
): # noqa: S107
github_headers = {
"content-type": CONTENT_TYPE_JSON,
"User-Agent": "Folio Client (https://github.com/FOLIO-FSE/FolioClient)",
"User-Agent": USER_AGENT_STRING,",
}
if personal_access_token:
github_headers["authorization"] = f"token {personal_access_token}"
Expand Down Expand Up @@ -487,7 +488,7 @@ def get_from_github(
version = self.get_module_version(repo)
github_headers = {
"content-type": CONTENT_TYPE_JSON,
"User-Agent": "Folio Client (https://github.com/FOLIO-FSE/FolioClient)",
"User-Agent": USER_AGENT_STRING,
}
if personal_access_token:
github_headers["authorization"] = f"token {personal_access_token}"
Expand Down Expand Up @@ -535,7 +536,7 @@ def fetch_github_schema(schema_url):
"""
github_headers = {
"content-type": CONTENT_TYPE_JSON,
"User-Agent": "Folio Client (https://github.com/FOLIO-FSE/FolioClient)",
"User-Agent": USER_AGENT_STRING,
"Authorization": f"token {os.environ.get('GITHUB_TOKEN', '')}",
}
schema_response = httpx.get(
Expand Down

0 comments on commit 1b485ac

Please sign in to comment.