pallets-eco / flask-debugtoolbar

A toolbar overlay for debugging Flask applications
https://flask-debugtoolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
953 stars 146 forks source link

Usage of deprecated function `Request.is_xhr` #131

Closed Bryan21B closed 4 years ago

Bryan21B commented 5 years ago

When using py.test a deprecation warning is shown for Flask-DebugToolbar:

lib/python3.7/site-packages/flask_debugtoolbar/__init__.py:190: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable if response.status_code in self._redirect_codes and not real_request.is_xhr:

It looks like it's linked to jsonify: https://github.com/pallets/flask/issues/2549

jeffwidman commented 4 years ago

Thanks! Fixed in https://github.com/mgood/flask-debugtoolbar/commit/7ce099c3d092cf0dcb106260396a86ba75627560.