flask-peewee
flask-peewee copied to clipboard
Internet explorer 9 support for the API
I recently ran into this in production. If you like the fix, I can put together a pull request, though it's just a couple of lines. I had to add cache control headers to the response to prevent the great IE9 from caching ajax requests.
class RestResource(RestResource): ... def response(self, data): kwargs = {} if request.is_xhr else {"indent": 2} resp = Response(json.dumps(data, **kwargs), mimetype="application/json") resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" resp.headers["Pragma"] = "no-cache" resp.headers["Expires"] = 0 return resp