From 24648d6d7466cc1a68a07d979988780af4066be0 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 31 Jan 2023 09:56:48 +0100 Subject: [PATCH] fix server config See: https://wordpress.org/support/topic/jetpack-conflict-15/ --- activitypub.php | 10 +--------- includes/rest/class-server.php | 35 ---------------------------------- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 includes/rest/class-server.php diff --git a/activitypub.php b/activitypub.php index 4d1abb1..cc07f5d 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.15.0 + * Version: 0.16.0 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT @@ -84,14 +84,6 @@ function init() { require_once \dirname( __FILE__ ) . '/includes/class-health-check.php'; \Activitypub\Health_Check::init(); - require_once \dirname( __FILE__ ) . '/includes/rest/class-server.php'; - \add_filter( - 'wp_rest_server_class', - function() { - return '\Activitypub\Rest\Server'; - } - ); - if ( \WP_DEBUG ) { require_once \dirname( __FILE__ ) . '/includes/debug.php'; } diff --git a/includes/rest/class-server.php b/includes/rest/class-server.php deleted file mode 100644 index ac89dca..0000000 --- a/includes/rest/class-server.php +++ /dev/null @@ -1,35 +0,0 @@ -get_content_type(); - - if ( ! $content_type ) { - return parent::dispatch( $request ); - } - - // check for content-sub-types like 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' - if ( \preg_match( '/application\/([a-zA-Z+_-]+\+)json/', $content_type['value'] ) ) { - $request->set_header( 'Content-Type', 'application/json' ); - } - - // make request filterable - $request = \apply_filters( 'activitypub_pre_dispatch_request', $request ); - - return parent::dispatch( $request ); - } -}