Add JSON endpoint for CAPTCHA rendering
To be used inside WP/WC registration form to construct URL for CAPTCHA page. [MAILPOET-6325]
This commit is contained in:
committed by
David Remer
parent
d2ebfba8c3
commit
df171fdcc7
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace MailPoet\API\JSON;
|
||||
|
||||
use MailPoet\API\JSON\v1\RedirectResponse;
|
||||
use MailPoet\Config\AccessControl;
|
||||
|
||||
abstract class Endpoint {
|
||||
@@ -41,6 +42,10 @@ abstract class Endpoint {
|
||||
return new ErrorResponse($errors, $meta, Response::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
public function redirectResponse($url) {
|
||||
return new RedirectResponse($url);
|
||||
}
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user