zulip/zerver
Mateusz Mandera ec6022a186 logging_util: Handle record.status_code missing in skip_200_and_304.
Fixes #14595.
Invalid HTTP requests could end up in an unhandled exception in
skip_200_and_304 due the record not having the status_code attribute
set. With this change we'll avoid the exception

Example:
curl  -X POST -H 'Transfer-Encoding : chunked' --data-binary 'a' 'http://zulipdev.com:9991/json/messages/57'

2020-04-21 10:56:22.007 WARN [django.server] "POST /json/messages/57 HTTP/1.1" 405 95
2020-04-21 10:56:22.007 INFO [django.server] code 400, message Bad request syntax ('a')
2020-04-21 10:56:22.008 WARN [django.server] "a" 400 -
2020-04-22 11:26:13 -07:00
..
data_import python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
lib logging_util: Handle record.status_code missing in skip_200_and_304. 2020-04-22 11:26:13 -07:00
management python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
migrations python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
openapi python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
templatetags python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
tests python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
tornado python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
views python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
webhooks python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
worker python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
__init__.py
apps.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
context_processors.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
decorator.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
filters.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
forms.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
logging_handlers.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
middleware.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
models.py python: Convert assignment type annotations to Python 3.6 style. 2020-04-22 11:02:32 -07:00
signals.py emails: Translate from_name of account security emails. 2020-02-18 17:45:33 -08:00