if (!$this->isRedirect()) {
throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status));
}
+
+ if (301 == $status && !array_key_exists('cache-control', $headers)) {
+ $this->headers->remove('cache-control');
+ }
}
/**
- * {@inheritdoc}
+ * Factory method for chainability.
+ *
+ * @param string $url The url to redirect to
+ * @param int $status The response status code
+ * @param array $headers An array of response headers
+ *
+ * @return static
*/
public static function create($url = '', $status = 302, $headers = array())
{
<html>
<head>
<meta charset="UTF-8" />
- <meta http-equiv="refresh" content="1;url=%1$s" />
+ <meta http-equiv="refresh" content="0;url=%1$s" />
<title>Redirecting to %1$s</title>
</head>