Commit 8e4e9b93 authored by David Foucher's avatar David Foucher
Browse files

Fix header capitalization and add condition to detect ESD calls

parent bc056815
Pipeline #3473 passed with stage
in 1 minute and 30 seconds
......@@ -45,16 +45,19 @@ def log_simulate(request, response, context, financements=None, errors=None):
"version": VERSION,
}, sort_keys=True))
application = request.headers.get('ORIGIN-USER')
if not application and request.headers.get('AUTHORIZATION'):
application = 'esd'
message_esd = {
"startup": "trefle",
"requestId": str(uuid.uuid4()),
"date": datetime.utcnow().isoformat(),
"remoteIP": request.headers.get("x-real-ip"),
"httpReferer": request.headers.get("referer"),
"httpUserAgent": request.headers.get("user-agent"),
"remoteIP": request.headers.get("X-REAL-IP"),
"httpReferer": request.headers.get("REFERER"),
"httpUserAgent": request.headers.get("USER-AGENT"),
"status": response.status,
"apiVersion": VERSION,
"application": request.headers.get('origin-user'),
"application": application,
}, sort_keys=True))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment