|
@@ 4794-4801 (lines=8) @@
|
| 4791 |
|
// are known to work with signature verification. A different method |
| 4792 |
|
// can be passed to the WP REST API via the '?_method=' parameter if |
| 4793 |
|
// needed. |
| 4794 |
|
if ( $_SERVER['REQUEST_METHOD'] !== 'GET' && $_SERVER['REQUEST_METHOD'] !== 'POST' ) { |
| 4795 |
|
$this->rest_authentication_status = new WP_Error( |
| 4796 |
|
'rest_invalid_request', |
| 4797 |
|
__( 'This request method is not supported.', 'jetpack' ), |
| 4798 |
|
array( 'status' => 400 ) |
| 4799 |
|
); |
| 4800 |
|
return null; |
| 4801 |
|
} |
| 4802 |
|
if ( $_SERVER['REQUEST_METHOD'] !== 'POST' && ! empty( $this->HTTP_RAW_POST_DATA ) ) { |
| 4803 |
|
$this->rest_authentication_status = new WP_Error( |
| 4804 |
|
'rest_invalid_request', |
|
@@ 4810-4821 (lines=12) @@
|
| 4807 |
|
); |
| 4808 |
|
return null; |
| 4809 |
|
} |
| 4810 |
|
if ( |
| 4811 |
|
isset( $_SERVER['CONTENT_TYPE'] ) && |
| 4812 |
|
$_SERVER['CONTENT_TYPE'] !== 'application/x-www-form-urlencoded' && |
| 4813 |
|
$_SERVER['CONTENT_TYPE'] !== 'application/json' |
| 4814 |
|
) { |
| 4815 |
|
$this->rest_authentication_status = new WP_Error( |
| 4816 |
|
'rest_invalid_request', |
| 4817 |
|
__( 'This Content-Type is not supported.', 'jetpack' ), |
| 4818 |
|
array( 'status' => 400 ) |
| 4819 |
|
); |
| 4820 |
|
return null; |
| 4821 |
|
} |
| 4822 |
|
|
| 4823 |
|
$verified = $this->verify_xml_rpc_signature(); |
| 4824 |
|
|