8000 [HttpFoundation] Remove Cache-Control when using https download via IE<9 (fixes #6750) · Pull Request #7153 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] Remove Cache-Control when using https download via IE<9 (fixes #6750) #7153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed regular expression
  • Loading branch information
Johannes Klauss committed Feb 22, 2013
commit 625558969b36a19cbead44879c158e5a3b5044d3
6 changes: 4 additions & 2 deletions src/Symfony/Component/HttpFoundation/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ public function prepare(Request $request)
* Check if we need to remove Cache-Control for ssl encrypted downloads when using IE < 9
* @link http://support.microsoft.com/kb/323308
*/
if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/(?i)msie [1-8]/', $request->isSecure()) && null === $request->server->get('HTTPS')) {
$this->headers->remove('Cache-Control');
if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/', $request->server->get('HTTP_USER_AGENT'), $matches) > 0 && null === $request->isSecure()) {
if (count($matches) > 1 && $matches[1] < 9) {
$this->headers->remove('Cache-Control');
}
}

return $this;
Expand Down
0