I configured sentry in my flask app. After that any error that was generated was getting posted to my account without any issue. But, all the PUT and POST requests are returned with 400 bad request. When sentry configuration and initialisation is commented out, it works properly. My flask app is using nginx as well and as per the documentation I had changed my nginx settings by providing proxy_pass header and also using ProxyFixer to set app.wsgi_app. But none of these changes are fixing the actual issue.
Sentry does not change any of the request lifecycle of your app. If you take the exact config and ONLY disable the init_app call on the Sentry object what happens?
If the request’s content-type is made : application/json the above problem is resolved. But, if that is not the case, it still persists. Please refer this link which explains the same problem. https://github.com/pallets/flask/issues/1786
What should we be doing for requests where application/json cannot be given as content-type ?