Symfony\Component\HttpFoundation\ResponseHeaderBag::remove PHP Метод

remove() публичный Метод

public remove ( $key )
    public function remove($key)
    {
        $uniqueKey = str_replace('_', '-', strtolower($key));
        unset($this->headerNames[$uniqueKey]);

        if ('set-cookie' === $uniqueKey) {
            $this->cookies = array();

            return;
        }

        parent::remove($key);

        if ('cache-control' === $uniqueKey) {
            $this->computedCacheControl = array();
        }
    }

Usage Example

Пример #1
0
 /**
  * Check if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9
  *
  * @link http://support.microsoft.com/kb/323308
  */
 protected function ensureIEOverSSLCompatibility(Request $request)
 {
     if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) {
         if (intval(preg_replace("/(MSIE )(.*?);/", "\$2", $match[0])) < 9) {
             $this->headers->remove('Cache-Control');
         }
     }
 }
All Usage Examples Of Symfony\Component\HttpFoundation\ResponseHeaderBag::remove