Merge pull request #19173 from edx/nadeem/OPS-3445

Upgrade gunicorn to 19.0 and make upgrade (OPS-3445)
This commit is contained in:
Nadeem Shahzad
2018-10-30 18:56:24 +05:00
committed by GitHub
12 changed files with 56 additions and 43 deletions

View File

@@ -135,11 +135,13 @@ def _get_xmodule_instance_args(request, task_id):
permit old-style xqueue callbacks directly to the appropriate module in the LMS.
The `task_id` is also passed to the tracking log function.
"""
host_header = 'HTTP_HOST' if request is not None and 'HTTP_HOST' in request.META else 'SERVER_NAME'
request_info = {'username': request.user.username,
'user_id': request.user.id,
'ip': request.META['REMOTE_ADDR'],
'agent': request.META.get('HTTP_USER_AGENT', '').decode('latin1'),
'host': request.META['SERVER_NAME'],
'host': request.META[host_header],
}
xmodule_instance_args = {'xqueue_callback_url_prefix': get_xqueue_callback_url_prefix(request),