Commit d8a4b762 by Alexander Makarov

Merge pull request #2170 from peeradach001/patch-2

fix
parents fb2bb91e 7c0b56cb
...@@ -96,7 +96,7 @@ class VerbFilter extends Behavior ...@@ -96,7 +96,7 @@ class VerbFilter extends Behavior
$verb = Yii::$app->getRequest()->getMethod(); $verb = Yii::$app->getRequest()->getMethod();
$allowed = array_map('strtoupper', $verbs); $allowed = array_map('strtoupper', $verbs);
if (!in_array($verb, array_map('strtoupper', $verbs))) { if (!in_array($verb, $allowed)) {
$event->isValid = false; $event->isValid = false;
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7 // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7
Yii::$app->getResponse()->getHeaders()->set('Allow', implode(', ', $allowed)); Yii::$app->getResponse()->getHeaders()->set('Allow', implode(', ', $allowed));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment