1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-19 02:17:38 +03:00

Fixes EDDN sending to be working.

NB: Due to, I assume, EDDN relay de-duplication of messages, it's been
difficult to 100% test this.  No errors thrown, and stock/release EDMC
also doesn't result in a new message arriving at my EDDN consumer.
This commit is contained in:
Athanasius 2019-09-11 15:00:54 +01:00
parent e2be3b98e6
commit 1cedfaf759
2 changed files with 4 additions and 3 deletions

View File

@ -276,7 +276,7 @@ class Auth(object):
config.save() # Save settings now for use by command-line app
def dump(self, r):
print('Auth\t' + r.url, r.status_code, r.reason and r.reason.decode('utf-8') or 'None', r.text.encode('utf-8'))
print('Auth\t' + r.url, r.status_code, r.reason and r.reason or 'None', r.text)
def base64URLEncode(self, text):
return base64.urlsafe_b64encode(text).decode().replace('=', '')

View File

@ -100,7 +100,7 @@ class EDDN(object):
uploaderID = uuid.uuid4().hex
config.set('uploaderID', uploaderID)
else:
uploaderID = cmdr.encode('utf-8')
uploaderID = cmdr
msg = OrderedDict([
('$schemaRef', msg['$schemaRef']),
@ -112,12 +112,13 @@ class EDDN(object):
('message', msg['message']),
])
print('plugins/eddn.py:send(): msg[header][softwareName] = "{}"'.format(msg['header']['softwareName']))
r = self.session.post(self.UPLOAD, data=json.dumps(msg), timeout=self.TIMEOUT)
if __debug__ and r.status_code != requests.codes.ok:
print('Status\t%s' % r.status_code)
print('URL\t%s' % r.url)
print('Headers\t%s' % r.headers)
print(('Content:\n%s' % r.text).encode('utf-8'))
print('Content:\n%s' % r.text)
r.raise_for_status()
def sendreplay(self):