/var/www/vhosts/nabawater/vendor/yiisoft/yii2/rest
NameSizeModeActions
Action.php35070644editdlrm
ActiveController.php45550644editdlrm
Controller.php29130644editdlrm
CreateAction.php19660644editdlrm
DeleteAction.php10710644editdlrm
IndexAction.php38760644editdlrm
OptionsAction.php13920644editdlrm
Serializer.php106960644editdlrm
UpdateAction.php15330644editdlrm
UrlRule.php99730644editdlrm
ViewAction.php8950644editdlrm
Edit: /var/www/vhosts/nabawater/vendor/yiisoft/yii2/rest/OptionsAction.php (1392B)
* @since 2.0 */ class OptionsAction extends \yii\base\Action { /** * @var array the HTTP verbs that are supported by the collection URL */ public $collectionOptions = ['GET', 'POST', 'HEAD', 'OPTIONS']; /** * @var array the HTTP verbs that are supported by the resource URL */ public $resourceOptions = ['GET', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']; /** * Responds to the OPTIONS request. * @param string $id */ public function run($id = null) { if (Yii::$app->getRequest()->getMethod() !== 'OPTIONS') { Yii::$app->getResponse()->setStatusCode(405); } $options = $id === null ? $this->collectionOptions : $this->resourceOptions; $headers = Yii::$app->getResponse()->getHeaders(); $headers->set('Allow', implode(', ', $options)); $headers->set('Access-Control-Allow-Methods', implode(', ', $options)); } }