)]}'
{"mistral/context.py":[{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"dabb6e36fe550e5bbda587c70aa5a02f55027dfd","unresolved":false,"context_lines":[{"line_number":249,"context_line":"class ContextHook(hooks.PecanHook):"},{"line_number":250,"context_line":"    def before(self, state):"},{"line_number":251,"context_line":"        try:"},{"line_number":252,"context_line":"            # Try to parse body and extract OOB parameters."},{"line_number":253,"context_line":"            _body \u003d json.loads(state.request.body)"},{"line_number":254,"context_line":"            _sc \u003d _body.pop(\"service_catalog\")"},{"line_number":255,"context_line":"            state.request.headers[\"X-Target-Service-Catalog\"] \u003d _sc"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_e928dce2","line":252,"range":{"start_line":252,"start_character":44,"end_line":252,"end_character":47},"updated":"2018-01-31 11:35:07.000000000","message":"OOB?","commit_id":"3d52dacf7888d1048ab31569d9dc4bdf9ac36d7c"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"dabb6e36fe550e5bbda587c70aa5a02f55027dfd","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            state.request.headers[\"X-Target-Service-Catalog\"] \u003d _sc"},{"line_number":256,"context_line":"            state.request.body \u003d json.dumps(_body)"},{"line_number":257,"context_line":"        except Exception:"},{"line_number":258,"context_line":"            pass"},{"line_number":259,"context_line":"        context \u003d MistralContext.from_environ("},{"line_number":260,"context_line":"            state.request.headers, state.request.environ"},{"line_number":261,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_49d310d6","line":258,"updated":"2018-01-31 11:35:07.000000000","message":"If I understand this correctly, we are adding an additional JSON loads (and potentially json.dumps) to every request. Could we maybe check to see if service_catalog is in the string? Then we will only attempt this if it is there. There could be some false positives, but it would greatly reduce the negative attempts I think.\n\nif \"service_catalog\" in state.request.body:\n    # attempt to load.","commit_id":"3d52dacf7888d1048ab31569d9dc4bdf9ac36d7c"}]}
