Skip to content

Commit e428f58

Browse files
author
Nikos Vasileiou
authored
Merge pull request #41 from transifex/sdk-header
Send Native SDK version to CDS
2 parents 6099c13 + 36beeb3 commit e428f58

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

tests/native/core/test_cds.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,22 @@ def test_get_headers(self):
435435
assert cds_handler._get_headers() == {
436436
'Authorization': 'Bearer some_token',
437437
'Accept-Encoding': 'gzip',
438+
'X-NATIVE-SDK': 'python',
438439
}
439440

440441
assert cds_handler._get_headers(use_secret=True) == {
441442
'Authorization': 'Bearer some_token:some_secret',
442443
'Accept-Encoding': 'gzip',
444+
'X-NATIVE-SDK': 'python',
443445
}
444446

445447
headers = cds_handler._get_headers(
446448
use_secret=True, etag='something')
447449
assert headers == {
448450
'Authorization': 'Bearer some_token:some_secret',
449451
'Accept-Encoding': 'gzip',
450-
'If-None-Match': 'something'
452+
'X-NATIVE-SDK': 'python',
453+
'If-None-Match': 'something',
451454
}
452455

453456
@responses.activate

transifex/native/cds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def _get_headers(self, use_secret=False, etag=None):
253253
secret=(':' + self.secret if use_secret else '')
254254
),
255255
'Accept-Encoding': 'gzip',
256+
'X-NATIVE-SDK': 'python',
256257
}
257258
if etag:
258259
headers['If-None-Match'] = etag

0 commit comments

Comments
 (0)