All rate limit exceeded responses seem to have the wrong Content-Type header and appear in the browser as plain text.
In the RateLimitExceeded class, get_headers() returns just the Retry-After header. I don't know the exact way any of the code works, but I assume this overrides the Content-Type header, which is returned in a different get_headers() in the werkzeug HTTPException class.
I was able to fix this for myself by changing the line from return {"Retry-After": str(self.retry_after)} to return {"Retry-After": str(self.retry_after), "Content-Type": "text/html; charset=utf-8"}
I don't know how this should be fixed, but I thought I'd leave this issue to highlight it.
All rate limit exceeded responses seem to have the wrong Content-Type header and appear in the browser as plain text.
In the RateLimitExceeded class, get_headers() returns just the Retry-After header. I don't know the exact way any of the code works, but I assume this overrides the Content-Type header, which is returned in a different get_headers() in the werkzeug HTTPException class.
I was able to fix this for myself by changing the line from
return {"Retry-After": str(self.retry_after)}
toreturn {"Retry-After": str(self.retry_after), "Content-Type": "text/html; charset=utf-8"}
I don't know how this should be fixed, but I thought I'd leave this issue to highlight it.