Skip to content

Commit

Permalink
Send CLI version to API in headers. Closes #189.
Browse files Browse the repository at this point in the history
  • Loading branch information
polyatail committed Jan 23, 2019
1 parent 909217c commit 00bf2e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onecodex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from onecodex.vendored.potion_client import Client as PotionClient
from onecodex.vendored.potion_client.converter import PotionJSONSchemaDecoder, PotionJSONDecoder, PotionJSONEncoder
from onecodex.vendored.potion_client.utils import upper_camel_case
from onecodex.version import __version__


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -78,6 +79,8 @@ def __init__(self, api_key=None,
elif api_key:
self._req_args['auth'] = HTTPBasicAuth(api_key, '')

self._req_args['headers'] = {'X-OneCodex-Client-User-Agent': __version__}

# Create client instance
self._client = ExtendedPotionClient(self._base_url, schema_path=self._schema_path,
fetch_schema=False, **self._req_args)
Expand Down

0 comments on commit 00bf2e2

Please sign in to comment.