. * */ namespace OC\AppFramework\Http; /** * Redirects to a different URL */ class RedirectResponse extends Response { private $redirectURL; /** * Creates a response that redirects to a url * @param string $redirectURL the url to redirect to */ public function __construct($redirectURL) { $this->redirectURL = $redirectURL; $this->setStatus(Http::STATUS_TEMPORARY_REDIRECT); $this->addHeader('Location', $redirectURL); } /** * @return string the url to redirect */ public function getRedirectURL() { return $this->redirectURL; } }