Allow POST method on GET endpoints

[MAILPOET-2628]
This commit is contained in:
Ján Mikláš
2020-01-13 10:24:25 +01:00
committed by Jack Kitterhing
parent 02a924ed28
commit 790ad7e80a

View File

@ -43,12 +43,11 @@ abstract class Endpoint {
}
public function isMethodAllowed($name, $type) {
// Block GET requests on POST endpoints, but allow POST requests on GET endpoints (some plugins
// change REQUEST_METHOD to POST on GET requests, which caused them to be blocked)
if ($type === self::TYPE_GET && !in_array($name, static::$get_methods)) {
return false;
}
if ($type === self::TYPE_POST && in_array($name, static::$get_methods)) {
return false;
}
return true;
}
}