From ec4e22f57084178f8f7ae804c4066debb6a6fe84 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 22 May 2023 13:34:14 +0200 Subject: [PATCH] fix routing checks --- includes/rest/class-server.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/rest/class-server.php b/includes/rest/class-server.php index 8962db8..7e52772 100644 --- a/includes/rest/class-server.php +++ b/includes/rest/class-server.php @@ -88,11 +88,11 @@ class Server { public static function authorize_activitypub_requests( $response, $handler, $request ) { $route = $request->get_route(); - if ( ! str_starts_with( $route, '/activitypub' ) ) { - return $response; - } - - if ( get_rest_url_by_path( 'webfinger' ) !== $route ) { + if ( + ! str_starts_with( $route, '/' . ACTIVITYPUB_REST_NAMESPACE ) || + str_starts_with( $route, '/' . \trailingslashit( ACTIVITYPUB_REST_NAMESPACE ) . 'webfinger' ) || + str_starts_with( $route, '/' . \trailingslashit( ACTIVITYPUB_REST_NAMESPACE ) . 'nodeinfo' ) + ) { return $response; }