
Description
When you deliver a "application/pdf" file to an IE lower than 9 via HTTPS the download will fail with an error thrown by the Internet Explorer stating:
Internet Explorer was unable to open this site. The requested site is either unavailable or cannot be found. Please try again later.
see http://support.microsoft.com/kb/323308 for this.
This is because of the Cache-Control
header that the Response
class sets up by default.
see http://php.net/manual/en/function.header.php#108766
I know that there is a fix for it on IE side, but a lot of our customer still use IE 8 and don't update. I fixed this in a crappy way, just checking if the user uses IE and the to be send Content-Type
matches application/pdf
in Reponse::prepare()
.
if(preg_match("/(msie)|(MSIE)/", $request->server->get('HTTP_USER_AGENT')) > 0 && preg_match("/(application\/pdf)/", $headers->get('Content-Type')) > 0) { $this->headers->remove('Cache-Control'); $this->headers->remove('pragma'); } return $this;
But I'm sure this can be fixed way better. It would be great if you guys fix this in the proper way.