make webfinger route available unsigned

This commit is contained in:
Django Doucet 2023-05-05 23:44:15 -06:00
parent b0edf9a765
commit f79200ef27

View file

@ -79,16 +79,15 @@ class Server {
* @return mixed|\WP_Error
*/
public static function authorize_activitypub_requests( $response, $handler, $request ) {
$maybe_activitypub = $request->get_route();
if ( str_starts_with( $maybe_activitypub, '/activitypub' ) ) {
$route = $request->get_route();
if ( str_starts_with( $route, '/activitypub' ) ) {
if ( 'POST' === $request->get_method() ) {
$verified_request = Signature::verify_http_signature( $request );
if ( \is_wp_error( $verified_request ) ) {
return $verified_request;
}
} else {
if ( '/activitypub/1.0/webfinger' !== $route ) {
// SecureMode/Authorized fetch.
$secure_mode = \get_option( 'activitypub_use_secure_mode', '0' );
if ( $secure_mode ) {
@ -100,4 +99,5 @@ class Server {
}
}
}
}
}