From 8ac02f61848a93633ba5a55b559afd15bafb1f86 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 6 Jan 2012 01:00:14 +0100 Subject: [PATCH] Application: $allowedMethods is deprecated --- Nette/Application/Application.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Nette/Application/Application.php b/Nette/Application/Application.php index 02785cbe..43156151 100644 --- a/Nette/Application/Application.php +++ b/Nette/Application/Application.php @@ -51,8 +51,8 @@ class Application extends Nette\Object /** @var array of function(Application $sender, \Exception $e); Occurs when an unhandled exception occurs in the application */ public $onError; - /** @var array of string */ - public $allowedMethods = array('GET', 'POST', 'HEAD', 'PUT', 'DELETE'); + /** @deprecated */ + public $allowedMethods; /** @var array of Request */ private $requests = array(); @@ -95,18 +95,6 @@ public function __construct(IPresenterFactory $presenterFactory, IRouter $router */ public function run() { - // check HTTP method - if ($this->allowedMethods) { - $method = $this->httpRequest->getMethod(); - if (!in_array($method, $this->allowedMethods, TRUE)) { - $this->httpResponse->setCode(Nette\Http\IResponse::S501_NOT_IMPLEMENTED); - $this->httpResponse->setHeader('Allow', implode(',', $this->allowedMethods)); - echo '

Method ' . htmlSpecialChars($method) . ' is not implemented

'; - return; - } - } - - // dispatching $request = NULL; $repeatedError = FALSE; do {