diff --git a/includes/class-signature.php b/includes/class-signature.php index f0ca349..0b2184d 100644 --- a/includes/class-signature.php +++ b/includes/class-signature.php @@ -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 ) ) {