mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-03 09:01:13 +03:00
Moved User Agent to constant
This is one of those things that really should be a constant anyway
This commit is contained in:
parent
5c4c9fd3a7
commit
e739923083
@ -37,6 +37,8 @@ SERVER_AUTH = 'https://auth.frontierstore.net'
|
|||||||
URL_AUTH = '/auth'
|
URL_AUTH = '/auth'
|
||||||
URL_TOKEN = '/token'
|
URL_TOKEN = '/token'
|
||||||
|
|
||||||
|
USER_AGENT = 'EDCD-{}-{}'.format(appname, appversion)
|
||||||
|
|
||||||
SERVER_LIVE = 'https://companion.orerve.net'
|
SERVER_LIVE = 'https://companion.orerve.net'
|
||||||
SERVER_BETA = 'https://pts-companion.orerve.net'
|
SERVER_BETA = 'https://pts-companion.orerve.net'
|
||||||
URL_QUERY = '/profile'
|
URL_QUERY = '/profile'
|
||||||
@ -167,7 +169,7 @@ class Auth(object):
|
|||||||
def __init__(self, cmdr):
|
def __init__(self, cmdr):
|
||||||
self.cmdr = cmdr
|
self.cmdr = cmdr
|
||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
self.session.headers['User-Agent'] = 'EDCD-{}-{}'.format(appname, appversion)
|
self.session.headers['User-Agent'] = USER_AGENT
|
||||||
self.verifier = self.state = None
|
self.verifier = self.state = None
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
@ -367,7 +369,7 @@ class Session(object):
|
|||||||
def start(self, access_token):
|
def start(self, access_token):
|
||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
self.session.headers['Authorization'] = 'Bearer {}'.format(access_token)
|
self.session.headers['Authorization'] = 'Bearer {}'.format(access_token)
|
||||||
self.session.headers['User-Agent'] = 'EDCD-{appname}-{version}'.format(appname=appname, version=appversion)
|
self.session.headers['User-Agent'] = USER_AGENT
|
||||||
self.state = Session.STATE_OK
|
self.state = Session.STATE_OK
|
||||||
|
|
||||||
def query(self, endpoint):
|
def query(self, endpoint):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user