mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-23 20:10:29 +03:00
Gateway: misc formatting pass
This commit is contained in:
parent
14a857a416
commit
daa1ae0ac1
@ -267,8 +267,8 @@ def parse_and_error_handle(data):
|
||||
validation_results = validator.validate(parsed_message)
|
||||
|
||||
if validation_results.severity <= ValidationSeverity.WARN:
|
||||
parsed_message['header']['gatewayTimestamp'] = datetime.utcnow().isoformat() + 'Z'
|
||||
parsed_message['header']['uploaderIP'] = get_remote_address()
|
||||
parsed_message['header']['gatewayTimestamp'] = datetime.utcnow().isoformat() + 'Z'
|
||||
parsed_message['header']['uploaderIP'] = get_remote_address()
|
||||
|
||||
# Sends the parsed message to the Relay/Monitor as compressed JSON.
|
||||
gevent.spawn(push_message, parsed_message, parsed_message['$schemaRef'])
|
||||
@ -396,7 +396,8 @@ class EnableCors(object):
|
||||
# set CORS headers
|
||||
response.headers['Access-Control-Allow-Origin'] = '*'
|
||||
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
|
||||
response.headers['Access-Control-Allow-Headers'] = 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
|
||||
response.headers['Access-Control-Allow-Headers'] = \
|
||||
'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
|
||||
|
||||
if request.method != 'OPTIONS':
|
||||
# actual request; reply with the actual response
|
||||
@ -416,12 +417,13 @@ def main():
|
||||
|
||||
app.install(EnableCors())
|
||||
app.run(
|
||||
host=Settings.GATEWAY_HTTP_BIND_ADDRESS,
|
||||
port=Settings.GATEWAY_HTTP_PORT,
|
||||
server='gevent',
|
||||
host=Settings.GATEWAY_HTTP_BIND_ADDRESS,
|
||||
port=Settings.GATEWAY_HTTP_PORT,
|
||||
server='gevent',
|
||||
certfile=Settings.CERT_FILE,
|
||||
keyfile=Settings.KEY_FILE
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user