From cce267f045d2ba2508cdd80ce518db300d3d6c3f Mon Sep 17 00:00:00 2001 From: Jordan Matelsky Date: Mon, 27 Nov 2023 10:40:02 -0500 Subject: [PATCH] Add user-agent to outgoing BossDB remote calls --- CHANGELOG.md | 8 ++++++++ intern/service/boss/baseversion.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a90017..9edbdce5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ --- +## v?.?.? (Unreleased) + +- **Improvements** + - Adds User-Agent headers to outgoing calls to BossDB (#110) + - Adds the ability to toggle the `public` status of a Boss Resource (#109) +- **Fixes** + - Fixes single-index cutouts in the CloudVolume convenience volume provider (#108) + ## v1.4.1 (March 2023) - **Improvements** diff --git a/intern/service/boss/baseversion.py b/intern/service/boss/baseversion.py index 5804ca29..d629c376 100644 --- a/intern/service/boss/baseversion.py +++ b/intern/service/boss/baseversion.py @@ -15,6 +15,7 @@ from abc import ABCMeta, abstractmethod from intern.resource.boss.resource import CoordinateFrameResource from requests import Request +from intern.version import __version__ @six.add_metaclass(ABCMeta) class BaseVersion(object): @@ -87,7 +88,8 @@ def get_headers(self, content_type, token): """ return { 'Authorization': 'Token ' + token, - 'Content-Type': content_type + 'Content-Type': content_type, + 'User-Agent': 'intern-py-{}'.format(__version__) } def build_url(self, resource, url_prefix, service, req_type='normal'):