Add a configuration line to the consensus-health Apache config
SetEnvIf X-Requested-With XMLHttpRequest no-gzip
legacy/trac#25588 (moved) is a feature to allow users to load individual relay details on the index page; without having to load the entire detailed page. It uses Range requests.
consensus-health.torproject.org currently supports Range requests, so no configuration needed for that:
curl -H "Range: bytes=0-100" -H "X-Requested-With: XMLHttpRequest" https://consensus-health.torproject.org
But using compression in conjunction with Range requests confuses Apache. (Should the Range be before the compression, or after? Apparently it's never been decided.)
So for AJAX requests we need to disable compression. The only thing making AJAX requests to consensus-health is my new feature so we're not going to be sending a ton of data uncompressed.
Once the configuration is correct, the following two commands will have the same output:
curl -H "Range: bytes=0-100" -H "X-Requested-With: XMLHttpRequest" https://consensus-health.torproject.org curl -H "Range: bytes=0-100" -H "X-Requested-With: XMLHttpRequest" https://consensus-health.torproject.org --compressed