Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpKernel\Exception; Chris@0: Chris@0: /** Chris@0: * @author Ben Ramsey Chris@0: */ Chris@0: class UnauthorizedHttpException extends HttpException Chris@0: { Chris@0: /** Chris@0: * @param string $challenge WWW-Authenticate challenge string Chris@0: * @param string $message The internal exception message Chris@0: * @param \Exception $previous The previous exception Chris@0: * @param int $code The internal exception code Chris@0: */ Chris@0: public function __construct($challenge, $message = null, \Exception $previous = null, $code = 0) Chris@0: { Chris@17: $headers = ['WWW-Authenticate' => $challenge]; Chris@0: Chris@0: parent::__construct(401, $message, $previous, $headers, $code); Chris@0: } Chris@0: }