Had an issue when trying to react to a chunked response from a server. The onreadystatechange function was being called only at the end, and not for intermediate values. Found the answer here:
- turns out, you need to set the header X-Content-Type-Options to nosniff