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 ) {
$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;
}