this function should not work without $request

This commit is contained in:
Matthias Pfefferle 2023-04-21 08:51:25 +02:00
parent 5a6f8aff02
commit 5faddba511

View file

@ -110,7 +110,7 @@ class Signature {
} }
} }
public static function verify_http_signature( $request = null ) { public static function verify_http_signature( $request ) {
$headers = $request->get_headers(); $headers = $request->get_headers();
$actor = isset( json_decode( $request->get_body() )->actor ) ? json_decode( $request->get_body() )->actor : ''; $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(); $headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' /wp-json' . $request->get_route();