I was doing some work on an eCeommerce system (OpenCart actually) and then all of a sudden I came across an error in my browser. As it was unexpected and I didn’t know where it came from I checked other browsers and found they were affected also.
The messages I got in the browsers were:
- Firefox: Content Encoding Error
- Chrome: net::ERR_CONTENT_DECODING_FAILED
- Internet Explorer: Internet Explorer cannot display the webpage
Although strangely when I used curl to check that the URL was accessible I got a stream of content displayed in my terminal.
The reason for this is that the browsers specify what content encoding they support when they send the web request, e.g. they can say to the web server “I support compressed responses!” and the server will then oblige with a compressed response (see this article on Wikipedia for full info).
I had accidentally inserted some white space at the start of one of my PHP classes – no errors, no warnings, no nothing – it could have been a real problem to track down.
Here’s some images of the problem in action, along with a screenshot of my terminal with the offending white space visible at the start of line one.