Skip to content

Commit 46a216d

Browse files
committed
use version number to build compliant http user agent
fixes the-library-code#26 (User-Agent string not compliant)
1 parent f608329 commit 46a216d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dspace_rest_client/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import os
2424
from uuid import UUID
2525
from .models import *
26+
from . import __version__
2627

2728
__all__ = ['DSpaceClient']
2829

@@ -56,7 +57,7 @@ class DSpaceClient:
5657
API_ENDPOINT = 'http://localhost:8080/server/api'
5758
SOLR_ENDPOINT = 'http://localhost:8983/solr'
5859
SOLR_AUTH = None
59-
USER_AGENT = 'DSpace Python REST Client'
60+
USER_AGENT = f'DSpace-Python-REST-Client/{__version__}'
6061
if 'DSPACE_API_ENDPOINT' in os.environ:
6162
API_ENDPOINT = os.environ['DSPACE_API_ENDPOINT']
6263
LOGIN_URL = f'{API_ENDPOINT}/authn/login'

0 commit comments

Comments
 (0)