fix rest api endpoint
This commit is contained in:
parent
d23ff46073
commit
1631f1c7dc
1 changed files with 5 additions and 3 deletions
|
@ -112,12 +112,14 @@ class Signature {
|
|||
|
||||
public static function verify_http_signature( $request ) {
|
||||
$headers = $request->get_headers();
|
||||
$actor = isset( json_decode( $request->get_body() )->actor ) ? json_decode( $request->get_body() )->actor : '';
|
||||
$headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' /wp-json' . $request->get_route();
|
||||
|
||||
if ( ! $headers ) {
|
||||
$headers = self::default_server_headers();
|
||||
return false;
|
||||
}
|
||||
|
||||
$actor = isset( json_decode( $request->get_body() )->actor ) ? json_decode( $request->get_body() )->actor : '';
|
||||
$headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' /' . rest_get_url_prefix() . $request->get_route();
|
||||
|
||||
if ( array_key_exists( 'signature', $headers ) ) {
|
||||
$signature_block = self::parse_signature_header( $headers['signature'] );
|
||||
} elseif ( array_key_exists( 'authorization', $headers ) ) {
|
||||
|
|
Loading…
Reference in a new issue