title: Weird "is_xhr" error when deploying Flask app to Heroku
body: <p>I have a flask app which I've deployed to Heroku, one of the routes is the following</p>
  
  <pre><code>def get_kws():
      seed_kw = request.json['firstParam']
      audience_max = request.json['secondParam']
      interest_mining_service = InterestMiningService(seed_kw, audience_max)
      query_result = interest_mining_service.query_keyword().tolist()
      if seed_kw in query_result:
          print ("yes")
          return jsonify(
              {
               'keyword_data' : interest_mining_service.find_kws().to_json(orient='records'),
               'query_results': query_result
              }
          )
  </code></pre>
  
  <p>When I test this endpoint locally, I have no issues when sending POST and GET requests to that endpoint. However, when I deploy to Heroku, I get the following error:</p>
  
  <pre class="lang-sh prettyprint-override"><code>File "/app/server/controller.py", line 24, in get_kws
  2020-02-08T22:31:05.893850+00:00 app[web.1]: 'query_results': query_result
  2020-02-08T22:31:05.893850+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/json.py", line 298, in jsonify
  2020-02-08T22:31:05.893851+00:00 app[web.1]: if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] and not request.is_xhr:
  2020-02-08T22:31:05.893851+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/werkzeug/local.py", line 347, in __getattr__
  2020-02-08T22:31:05.893852+00:00 app[web.1]: return getattr(self._get_current_object(), name)
  2020-02-08T22:31:05.893858+00:00 app[web.1]: AttributeError: 'Request' object has no attribute 'is_xhr'
  </code></pre>
  
  <p>I've never seen this error <code>Request object has no attribute 'is_xhr'</code> before and it only seems to be happening when I deploy to Heroku. Any guidance on what I should look into?</p>
  
  <p>There also doesn't seem to be an issue with the json key <code>keyword_data</code> - the issue seems limited to <code>query_results</code> which is a list.</p>