Skip to content

Commit

Permalink
fixup! Add tracking headers
Browse files Browse the repository at this point in the history
  • Loading branch information
eccles committed Jun 12, 2024
1 parent d486fd4 commit 507b124
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion archivist/archivistpublic.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
HEADERS_TOTAL_COUNT,
PARTNER_ID,
USER_AGENT,
USER_AGENT_PREFIX,
)
from .dictmerge import _deepmerge, _dotdict
from .errors import (
Expand Down Expand Up @@ -185,7 +186,7 @@ def __copy__(self):

def _add_headers(self, headers: "dict[str, str]|None") -> "dict[str, str]":
newheaders = {**headers} if headers is not None else {}
newheaders[USER_AGENT] = f"datatrails/pysdk/{self.version}"
newheaders[USER_AGENT] = f"{USER_AGENT_PREFIX}{self.version}"
p = self.partner_id
if p:
newheaders[PARTNER_ID] = p
Expand Down
6 changes: 3 additions & 3 deletions archivist/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"RecordEvidence",
]

USER_AGENT = "Archivist-User-Agent"
USER_AGENT_PREFIX = "datatrails/pysdk/"
PARTNER_ID = "Archivist-Partner-ID"
USER_AGENT = "DataTrails-User-Agent"
USER_AGENT_PREFIX = "pysdk/"
PARTNER_ID = "DataTrails-Partner-ID"

# define in MIME canonical form
HEADERS_REQUEST_TOTAL_COUNT = "X-Request-Total-Count"
Expand Down

0 comments on commit 507b124

Please sign in to comment.