From 8e9d62b5c5b4f5ddd935c959cd1bc0df503089dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 20 Jul 2016 14:26:36 +0200 Subject: [PATCH] Include addon version in all Pillar HTTP requests --- blender_cloud/pillar.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blender_cloud/pillar.py b/blender_cloud/pillar.py index ef69d6d..c15763f 100644 --- a/blender_cloud/pillar.py +++ b/blender_cloud/pillar.py @@ -157,6 +157,12 @@ def pillar_api(pillar_endpoint: str = None, caching=True) -> pillarsdk.Api: token=subclient['token']) _noncaching_api.requests_session = uncached_session + # Send the addon version as HTTP header. + from blender_cloud import bl_info + addon_version = '.'.join(str(v) for v in bl_info['version']) + _caching_api.global_headers['Blender-Cloud-Addon'] = addon_version + _noncaching_api.global_headers['Blender-Cloud-Addon'] = addon_version + _pillar_api = { True: _caching_api, False: _noncaching_api,