fix routing checks

This commit is contained in:
Matthias Pfefferle 2023-05-22 13:34:14 +02:00
parent 467a349b16
commit ec4e22f570

View file

@ -88,11 +88,11 @@ class Server {
public static function authorize_activitypub_requests( $response, $handler, $request ) { public static function authorize_activitypub_requests( $response, $handler, $request ) {
$route = $request->get_route(); $route = $request->get_route();
if ( ! str_starts_with( $route, '/activitypub' ) ) { if (
return $response; ! 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' )
if ( get_rest_url_by_path( 'webfinger' ) !== $route ) { ) {
return $response; return $response;
} }