Allow POST method on GET endpoints
[MAILPOET-2628]
This commit is contained in:
committed by
Jack Kitterhing
parent
02a924ed28
commit
790ad7e80a
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user