зеркало из https://github.com/mozilla/server-core.git
log a warning if a controller action returns unicode instead of a string
This commit is contained in:
Родитель
758f16c1a0
Коммит
c24e819b17
|
@ -216,7 +216,11 @@ class SyncServerApp(object):
|
|||
elif isinstance(result, str):
|
||||
response.body = result
|
||||
else:
|
||||
# if it's not str it's unicode
|
||||
# if it's not str it's unicode, which really shouldn't happen
|
||||
module = getattr(function, '__module__', 'unknown')
|
||||
name = getattr(function, '__name__', 'unknown')
|
||||
logger.warn('Unicode response returned from: %s - %s'
|
||||
% (module, name))
|
||||
response.unicode_body = result
|
||||
else:
|
||||
# result is already a Response
|
||||
|
|
Загрузка…
Ссылка в новой задаче