get_content_type(); // 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 ); } }