Fix query-arg escaping defect uncovered by proper testing.

This commit is contained in:
Dave Shawley 2015-09-14 07:28:23 -04:00
parent c1349ba8b2
commit 5ae094d9be

View file

@ -18,8 +18,9 @@ import sys
import traceback import traceback
try: try:
from tornado import log from tornado import escape, log
except ImportError: except ImportError: # pragma no cover
escape = None
log = None log = None
version_info = (1, 3, 0) version_info = (1, 3, 0)
@ -148,7 +149,8 @@ def tornado_log_function(handler):
'method': handler.request.method, 'method': handler.request.method,
'path': handler.request.path, 'path': handler.request.path,
'protocol': handler.request.protocol, 'protocol': handler.request.protocol,
'query_args': handler.request.query_arguments, 'query_args': escape.recursive_unicode(
handler.request.query_arguments),
'remote_ip': handler.request.remote_ip, 'remote_ip': handler.request.remote_ip,
'status_code': status_code, 'status_code': status_code,
'environment': os.environ.get('ENVIRONMENT')}) 'environment': os.environ.get('ENVIRONMENT')})