mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-05 09:53:33 +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:
parent
e2be3b98e6
commit
1cedfaf759
@ -276,7 +276,7 @@ class Auth(object):
|
|||||||
config.save() # Save settings now for use by command-line app
|
config.save() # Save settings now for use by command-line app
|
||||||
|
|
||||||
def dump(self, r):
|
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):
|
def base64URLEncode(self, text):
|
||||||
return base64.urlsafe_b64encode(text).decode().replace('=', '')
|
return base64.urlsafe_b64encode(text).decode().replace('=', '')
|
||||||
|
@ -100,7 +100,7 @@ class EDDN(object):
|
|||||||
uploaderID = uuid.uuid4().hex
|
uploaderID = uuid.uuid4().hex
|
||||||
config.set('uploaderID', uploaderID)
|
config.set('uploaderID', uploaderID)
|
||||||
else:
|
else:
|
||||||
uploaderID = cmdr.encode('utf-8')
|
uploaderID = cmdr
|
||||||
|
|
||||||
msg = OrderedDict([
|
msg = OrderedDict([
|
||||||
('$schemaRef', msg['$schemaRef']),
|
('$schemaRef', msg['$schemaRef']),
|
||||||
@ -112,12 +112,13 @@ class EDDN(object):
|
|||||||
('message', msg['message']),
|
('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)
|
r = self.session.post(self.UPLOAD, data=json.dumps(msg), timeout=self.TIMEOUT)
|
||||||
if __debug__ and r.status_code != requests.codes.ok:
|
if __debug__ and r.status_code != requests.codes.ok:
|
||||||
print('Status\t%s' % r.status_code)
|
print('Status\t%s' % r.status_code)
|
||||||
print('URL\t%s' % r.url)
|
print('URL\t%s' % r.url)
|
||||||
print('Headers\t%s' % r.headers)
|
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()
|
r.raise_for_status()
|
||||||
|
|
||||||
def sendreplay(self):
|
def sendreplay(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user