From a138924aa22293d488f136caa1223b4cc0638d4a Mon Sep 17 00:00:00 2001 From: Iva Kaneva Date: Mon, 19 Mar 2018 19:31:08 +0200 Subject: [PATCH] Recognize Content Type ending with `+json` as JSON type Sentry should recognize API JSON requests as JSON type not as Form. If they are recognized as Form the body payload appears empty in Sentry UI. RFC6839: https://tools.ietf.org/html/rfc6839#page-4 --- raven/contrib/flask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raven/contrib/flask.py b/raven/contrib/flask.py index 40c7fb3b5..bfdec1e47 100644 --- a/raven/contrib/flask.py +++ b/raven/contrib/flask.py @@ -193,7 +193,7 @@ def get_http_info(self, request): return self.get_http_info_with_retriever(request, retriever) def is_json_type(self, content_type): - return content_type == 'application/json' + return content_type == 'application/json' or content_type.endswith('+json') def get_form_data(self, request): return request.form